/* ==========================================================================
   Online Tools Hub — WisprFlow-Inspired Editorial Design
   Style: Warm editorial, minimal, clean whitespace, serif+sans typography
   Palette: Warm cream (#FFFEF9), Forest green accents, Dark ink text
   ========================================================================== */

/* Fonts loaded via <link rel="preload"> in index.html for zero FOUT — do NOT re-add @import here */

/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */
:root {
  /* Editorial Palette — Warm Cream + Forest Green */
  --brand-green: #1a6a58;
  --brand-green-mid: #1d7a65;
  --brand-green-lite: #e9f4f1;
  --brand-ink: #111111;
  --brand-ink-60: rgba(17, 17, 17, 0.6);
  --brand-ink-35: rgba(17, 17, 17, 0.35);
  --brand-ink-12: rgba(17, 17, 17, 0.12);
  --brand-ink-06: rgba(17, 17, 17, 0.06);

  --accent-amber: #e8892a;
  --accent-amber-bg: #fff7eb;
  --accent-blue: #3b6df0;
  --accent-rose: #e5414b;
  --accent-purple: #7c3aed;
  --accent-teal: #0891b2;

  /* Backgrounds */
  --bg-page: #FFFEF9;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F9F8F4;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAFAF7;
  --bg-input: #F5F4F0;
  --bg-nav: rgba(255, 254, 249, 0.92);

  /* Borders */
  --border-light: rgba(17, 17, 17, 0.1);
  --border-mid: rgba(17, 17, 17, 0.15);
  --border-focus: #1a6a58;
  --border-color: rgba(17, 17, 17, 0.1);

  /* Text */
  --text-primary: #111111;
  --text-secondary: rgba(17, 17, 17, 0.65);
  --text-muted: rgba(17, 17, 17, 0.45);
  --text-inverse: #FFFFFF;

  /* Shadows — subtle, editorial */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-green: 0 4px 24px rgba(26, 106, 88, 0.2);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 9999px;
  --r-full: 9999px;

  /* Transitions */
  --ease-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography */
  --font-telugu: 'Mandali', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Figtree', 'Mandali', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-brand: 'Playfair Display', Georgia, 'Times New Roman', serif;
  /* Backward-compat aliases — used by tool JS inline styles */
  --primary: #1a6a58;
  --primary-rgb: 26, 106, 88;
  --primary-hover: #1d7a65;
  --primary-gradient: linear-gradient(135deg, #1a6a58 0%, #0d4a3a 100%);
  --success: var(--brand-green);
  --warning: #d97706;
  --danger: #dc2626;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  --border-subtle: rgba(17, 17, 17, 0.1);
  --border-focus: #1a6a58;
  --border-card: rgba(17, 17, 17, 0.1);
  --glass-bg: rgba(255, 254, 249, 0.85);
  --glass-border: rgba(255, 254, 249, 0.6);
  --glass-blur: blur(16px);
  --shadow-glow: 0 0 25px -5px rgba(26, 106, 88, 0.25);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Mobile Tap Highlight Reset */
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent !important;
}

a,
button,
input,
select,
textarea,
label,
[role="button"],
.tp-btn,
.tp-card,
.tp-dh-card {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  -webkit-touch-callout: none;
}


/* Dark Mode */
[data-theme="dark"] {
  --brand-green: #34d399;
  --brand-green-mid: #2dd4bf;
  --brand-green-lite: #052e22;
  --brand-ink: #f0ede8;
  --brand-ink-60: rgba(240, 237, 232, 0.6);
  --brand-ink-35: rgba(240, 237, 232, 0.35);
  --brand-ink-12: rgba(240, 237, 232, 0.12);
  --brand-ink-06: rgba(240, 237, 232, 0.06);

  --bg-page: #0d0d0b;
  --bg-surface: #131310;
  --bg-surface-alt: #1a1a16;
  --bg-card: #1a1a16;
  --bg-card-hover: #202019;
  --bg-input: #1e1e1a;
  --bg-nav: rgba(13, 13, 11, 0.92);

  --border-light: rgba(240, 237, 232, 0.1);
  --border-mid: rgba(240, 237, 232, 0.15);
  --border-focus: #34d399;
  --border-color: rgba(240, 237, 232, 0.1);

  --text-primary: #f0ede8;
  --text-secondary: rgba(240, 237, 232, 0.65);
  --text-muted: rgba(240, 237, 232, 0.4);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.7);

  /* Dark mode backward-compat aliases */
  --primary: #34d399;
  --primary-hover: #2dd4bf;
  --border-subtle: rgba(240, 237, 232, 0.1);
  --border-card: rgba(240, 237, 232, 0.1);
  --glass-bg: rgba(26, 26, 22, 0.9);
  --glass-border: rgba(240, 237, 232, 0.1);
  --shadow-glow: 0 0 30px -5px rgba(52, 211, 153, 0.3);
  --shadow-card-hover: 0 20px 40px rgba(0, 0, 0, 0.7);
}

/* Backward-compat utility classes used by tool JS files */
.tp-btn-block {
  width: 100%;
  justify-content: center;
}

.tp-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--brand-green-lite);
  color: var(--brand-green);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tp-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 20px;
  cursor: default;
  transition: var(--ease-fast);
}

.tp-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   EDITORIAL FORM CONTROLS: Inputs, Selects, Textareas & Form Grids
   ========================================================================== */
.tp-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 20px;
}

.tp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
}

.tp-form-group label,
label.tp-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Text & Number Inputs */
.tp-input {
  width: 100%;
  height: 46px;
  padding: 10px 16px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast), background var(--ease-fast);
  box-shadow: var(--shadow-xs);
  outline: none;
  box-sizing: border-box;
}

.tp-input:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3.5px rgba(26, 106, 88, 0.14);
  background: var(--bg-surface);
}

.tp-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

/* Custom Select Dropdowns */
.tp-select {
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 8px 38px 8px 14px;
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231a6a58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  color: var(--text-primary);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
  box-sizing: border-box;
}

.tp-select:hover {
  border-color: var(--border-mid);
}

.tp-select:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3.5px rgba(26, 106, 88, 0.14);
}

.tp-select-sm,
.tp-rec-select {
  width: auto;
  min-width: 100px;
  height: auto !important;
  min-height: 36px !important;
  line-height: 1.3 !important;
  padding: 6px 30px 6px 14px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: var(--r-pill, 9999px) !important;
  background-position: right 10px center !important;
  background-size: 13px !important;
  border: 1.5px solid var(--border-mid) !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

.tp-select-sm:focus,
.tp-rec-select:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 2px rgba(26, 106, 88, 0.15);
}

/* Editorial Textareas */
.tp-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.65;
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast), background var(--ease-fast);
  box-shadow: var(--shadow-xs);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.tp-textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3.5px rgba(26, 106, 88, 0.14);
  background: var(--bg-surface);
}

.tp-textarea[readonly] {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  border-color: var(--border-light);
  cursor: text;
}

.tp-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

/* Framed Panel Card for Code/Prompt/Translation */
.tp-panel-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--ease-normal);
  display: flex;
  flex-direction: column;
}

.tp-panel-box:hover,
.tp-panel-box:focus-within {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-md);
}

.tp-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tp-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   BASE RESET & GLOBAL
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   VIEW TRANSITION — Circular Theme Ripple & Fallbacks
   ========================================================================== */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
}

/* Coordinated fallback when View Transitions API is not active */
.tp-theme-switching,
.tp-theme-switching *,
.tp-theme-switching *::before,
.tp-theme-switching *::after {
  transition: background-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    fill 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transition-delay: 0s !important;
}

/* Layout Container */
.tp-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

img {
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   GLOBAL PROGRESS BAR
   ========================================================================== */
.tp-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.tp-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #06b6d4, #3b82f6, #6366f1);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   TOP NAVIGATION — Floating Glassmorphic Pill
   ========================================================================== */
.tp-navbar {
  position: sticky;
  top: 12px;
  z-index: 500;
  width: 100%;
  pointer-events: none;
  background: transparent;
  border: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-navbar .tp-container {
  max-width: 1460px;
  padding: 0 24px;
}

.tp-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 56px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 14px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  box-shadow:
    0 10px 32px -4px rgba(0, 0, 0, 0.06),
    0 2px 8px -2px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(17, 17, 17, 0.05);
  pointer-events: auto;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

[data-theme="dark"] .tp-nav-inner {
  background: rgba(19, 21, 20, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 12px 36px -4px rgba(0, 0, 0, 0.55),
    0 2px 8px -2px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
}

/* Brand Group (Logo + Daily Hub) */
.tp-nav-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.tp-nav-links-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tp-brand-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Brand */
.tp-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  padding: 3px 6px 3px 2px;
  border-radius: 8px;
  transition: opacity 0.2s ease;
}

.tp-brand-wrap:hover {
  opacity: 0.9;
}

.tp-brand-logo {
  height: 50px;
  width: auto;
  max-width: 56px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-brand-wrap:hover .tp-brand-logo {
  transform: scale(1.06);
}

.tp-brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-brand-text {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.tp-brand-tp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-green);
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: var(--r-xs, 4px);
  line-height: 1.2;
}

[data-theme="dark"] .tp-brand-tp {
  background: var(--brand-green);
  color: #042f2e;
}

.tp-brand-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--brand-green-lite);
  color: var(--brand-green);
  border-radius: var(--r-pill);
  border: 1px solid rgba(26, 106, 88, 0.2);
}

/* Nav Categories (Desktop) */
.tp-nav-categories {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Nav Search */
.tp-nav-search {
  width: 250px;
  flex: 0 1 250px;
  min-width: 140px;
  margin: 0;
  margin-left: 12px;
  margin-right: auto;
  position: relative;
  transition: width 0.25s ease, flex-basis 0.25s ease;
}

@media (min-width: 1400px) {
  .tp-nav-search {
    width: 290px;
    flex: 0 1 290px;
  }
}

.tp-nav-search-btn {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 8px;
  min-width: 0;
}

.tp-nav-search-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
}

.tp-nav-search-icon {
  flex-shrink: 0;
}

.tp-nav-search-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-nav-search-btn:hover {
  border-color: rgba(26, 106, 88, 0.35);
  background: rgba(26, 106, 88, 0.05);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(26, 106, 88, 0.08);
}

[data-theme="dark"] .tp-nav-search-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tp-nav-search-btn:hover {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--text-primary);
}

.tp-kbd-hint {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--text-muted);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .tp-kbd-hint {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

/* Right Nav Actions */
.tp-nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tp-nav-link {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.tp-nav-link:hover,
.tp-nav-link.active {
  color: var(--brand-green);
  background: var(--brand-green-lite);
}

[data-theme="dark"] .tp-nav-link:hover,
[data-theme="dark"] .tp-nav-link.active {
  color: var(--brand-green);
  background: rgba(52, 211, 153, 0.12);
}

.tp-nav-link.active {
  font-weight: 700;
}

/* More Categories Dropdown */
.tp-nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tp-nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: transparent;
  border: none;
}

.tp-nav-more-btn .tp-nav-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  flex-shrink: 0;
}

.tp-nav-dropdown.open .tp-nav-more-btn .tp-nav-chevron {
  transform: rotate(180deg);
}

.tp-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: 12px;
  padding: 6px;
  box-shadow:
    0 12px 32px -4px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.18s;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[data-theme="dark"] .tp-nav-dropdown-menu {
  background: #181916;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 14px 36px -4px rgba(0, 0, 0, 0.65),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.tp-nav-dropdown.open .tp-nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.tp-nav-dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tp-nav-dropdown-item:hover,
.tp-nav-dropdown-item.active,
.tp-nav-dropdown-item:focus {
  color: var(--brand-green);
  background: var(--brand-green-lite);
  outline: none;
}

[data-theme="dark"] .tp-nav-dropdown-item:hover,
[data-theme="dark"] .tp-nav-dropdown-item.active,
[data-theme="dark"] .tp-nav-dropdown-item:focus {
  color: var(--brand-green);
  background: rgba(52, 211, 153, 0.12);
}

.tp-nav-dropdown-divider {
  height: 1px;
  background: var(--border-light, rgba(17, 17, 17, 0.08));
  margin: 5px 4px;
}

[data-theme="dark"] .tp-nav-dropdown-divider {
  background: rgba(255, 255, 255, 0.1);
}

/* Daily Hub Navigation Link (Beside Logo) */
.tp-nav-link-daily {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill, 9999px);
  background: rgba(26, 106, 88, 0.08);
  color: var(--brand-green, #1a6a58) !important;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(26, 106, 88, 0.2);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.tp-nav-link-daily:hover {
  background: var(--brand-green) !important;
  color: #ffffff !important;
  border-color: var(--brand-green);
  box-shadow: 0 4px 12px rgba(26, 106, 88, 0.2);
}

[data-theme="dark"] .tp-nav-link-daily {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.25);
}

[data-theme="dark"] .tp-nav-link-daily:hover {
  background: #10b981 !important;
  color: #042f2e !important;
}

/* Pulsing Live Beacon Indicator */
.tp-nav-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: tp-pulse-beacon 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
  display: inline-block;
  flex-shrink: 0;
}

@keyframes tp-pulse-beacon {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Mobile Quick Daily Hub Pill Button */
.tp-mobile-daily-btn {
  display: none;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-pill, 9999px);
  background: rgba(26, 106, 88, 0.09);
  border: 1px solid rgba(26, 106, 88, 0.22);
  color: var(--brand-green, #1a6a58);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.tp-mobile-daily-btn:hover,
.tp-mobile-daily-btn:active {
  background: var(--brand-green);
  color: #ffffff;
}

[data-theme="dark"] .tp-mobile-daily-btn {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
  color: #34d399;
}

/* Support & Feedback Navbar Button */
.tp-nav-support-btn {
  display: flex;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(17, 17, 17, 0.08);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.tp-nav-support-btn:hover {
  color: var(--brand-green);
  border-color: rgba(26, 106, 88, 0.3);
  background: var(--brand-green-lite);
  transform: scale(1.06);
}

[data-theme="dark"] .tp-nav-support-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

[data-theme="dark"] .tp-nav-support-btn:hover {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--brand-green);
  transform: scale(1.06);
}

/* Daily Hub Navbar Pill Button (Beside Dictionary) */
.tp-nav-daily-bubble-btn {
  position: relative;
  width: auto !important;
  padding: 0 12px 0 10px;
  gap: 6px;
  border-radius: var(--r-pill, 9999px) !important;
  background: var(--brand-green-lite, #e9f4f1) !important;
  border: 1px solid rgba(26, 106, 88, 0.22) !important;
  color: var(--brand-green, #1a6a58) !important;
  font-family: var(--font-sans);
}

.tp-nav-daily-bubble-btn:hover {
  background: var(--brand-green, #1a6a58) !important;
  border-color: var(--brand-green, #1a6a58) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 10px rgba(26, 106, 88, 0.2);
}

.tp-nav-daily-bubble-btn:hover .tp-nav-daily-text {
  color: #ffffff !important;
}

.tp-nav-daily-bubble-btn:hover .tp-nav-live-dot {
  background: #ffffff !important;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .tp-nav-daily-bubble-btn {
  background: rgba(52, 211, 153, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.28) !important;
  color: #34d399 !important;
}

[data-theme="dark"] .tp-nav-daily-bubble-btn:hover {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #042f2e !important;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .tp-nav-daily-bubble-btn:hover .tp-nav-daily-text {
  color: #042f2e !important;
}

[data-theme="dark"] .tp-nav-daily-bubble-btn:hover .tp-nav-live-dot {
  background: #042f2e !important;
}

.tp-nav-daily-bubble-btn .tp-nav-daily-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: inherit;
  white-space: nowrap;
  letter-spacing: -0.01em;
  line-height: 1;
}

.tp-nav-daily-bubble-btn .tp-nav-live-dot {
  position: relative;
  top: auto;
  right: auto;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  margin-left: -1px;
}

/* Speech-bubble hint callout on Daily Hub button */
.tp-daily-hint-bubble {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) scale(0.75);
  background: #134e42;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 4px 10px;
  border-radius: var(--r-pill, 9999px);
  white-space: nowrap;
  pointer-events: none;
  z-index: 600;
  opacity: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: tpDailyHintAnim 3.4s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
  will-change: transform, opacity;
}

/* Upward pointing arrow */
.tp-daily-hint-bubble::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #134e42;
}

[data-theme="dark"] .tp-daily-hint-bubble {
  background: #10b981;
  color: #042f2e;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 14px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .tp-daily-hint-bubble::before {
  border-bottom-color: #10b981;
}

.tp-nav-daily-bubble-btn:hover .tp-daily-hint-bubble {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

@keyframes tpDailyHintAnim {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px) scale(0.7);
  }
  14% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.04);
  }
  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  85% {
    opacity: 0.7;
    transform: translateX(-50%) translateY(-2px) scale(0.96);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.75);
    visibility: hidden;
  }
}

@media (max-width: 860px) {
  .tp-nav-daily-bubble-btn {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    justify-content: center;
    border-radius: var(--r-pill, 9999px) !important;
    gap: 0;
  }

  .tp-nav-daily-bubble-btn .tp-nav-daily-text {
    display: none !important;
  }

  .tp-nav-daily-bubble-btn .tp-nav-live-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    margin-left: 0;
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 480px) {
  .tp-nav-daily-bubble-btn {
    width: 32px !important;
    height: 32px !important;
  }

  .tp-nav-daily-bubble-btn .tp-nav-live-dot {
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
  }
}

/* Mobile search btn */
.tp-mobile-search-btn {
  display: none;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(17, 17, 17, 0.08);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.tp-mobile-search-btn:hover {
  color: var(--brand-green);
  border-color: rgba(26, 106, 88, 0.3);
  background: var(--brand-green-lite);
  transform: scale(1.06);
}

[data-theme="dark"] .tp-mobile-search-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

[data-theme="dark"] .tp-mobile-search-btn:hover {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--brand-green);
  transform: scale(1.06);
}

/* Theme Toggle */
.tp-theme-toggle {
  width: 38px;
  height: 38px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
  flex-shrink: 0;
  overflow: hidden;
}

/* Visible Focus Rings for Navigation Elements */
.tp-nav-search-btn:focus-visible,
.tp-nav-link:focus-visible,
.tp-nav-more-btn:focus-visible,
.tp-nav-support-btn:focus-visible,
.tp-theme-toggle:focus-visible,
.tp-mobile-search-btn:focus-visible,
.tp-nav-dropdown-item:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

.tp-theme-toggle svg {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: block;
}

.tp-theme-toggle.theme-rotating svg {
  transform: rotate(360deg) scale(0.65);
}

.tp-theme-toggle:hover {
  color: var(--brand-green);
  border-color: rgba(26, 106, 88, 0.3);
  background: var(--brand-green-lite);
  transform: scale(1.08);
}

[data-theme="dark"] .tp-theme-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

[data-theme="dark"] .tp-theme-toggle:hover {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--brand-green);
  transform: scale(1.08);
}

/* ==========================================================================
   HERO SECTION — WisprFlow editorial style
   ========================================================================== */
.tp-hero {
  position: relative;
  padding: 80px 0 56px;
  overflow: hidden;
  background: var(--bg-page);
}

/* Subtle dot-grid background with smooth bottom feather */
.tp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--brand-ink-06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 92%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 92%);
}

/* Soft green glow from center with natural feathered fade */
.tp-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 700px 320px at 50% 20%, rgba(26, 106, 88, 0.08) 0%, rgba(26, 106, 88, 0.02) 45%, transparent 75%);
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 0%, black 40%, transparent 88%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 40%, transparent 88%);
}

/* Seamless bottom gradient transition to prevent any visible cutoff line */
.tp-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent, var(--bg-page));
  pointer-events: none;
  z-index: 1;
}

.tp-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

/* Category Tag like WisprFlow */
.tp-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  border: 1px solid rgba(26, 106, 88, 0.25);
  border-radius: var(--r-pill);
  padding: 6px 16px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(26, 106, 88, 0.08);
  transition: all 0.25s ease;
  cursor: pointer;
}

.tp-hero-pill:hover {
  border-color: var(--brand-green);
  box-shadow: 0 4px 14px rgba(26, 106, 88, 0.16);
  transform: translateY(-1px);
}

.tp-hero-pill-dot {
  width: 7px;
  height: 7px;
  background: var(--brand-green);
  border-radius: 50%;
  animation: tp-pulse 2s ease infinite;
  flex-shrink: 0;
}

.tp-hero-sparkles-icon {
  flex-shrink: 0;
  color: var(--brand-green);
  transition: transform 0.3s ease;
  animation: tp-sparkle-pulse 2.4s ease-in-out infinite;
}

.tp-hero-pill:hover .tp-hero-sparkles-icon {
  transform: rotate(15deg) scale(1.15);
}

@keyframes tp-sparkle-pulse {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.18) rotate(12deg);
    opacity: 1;
  }
}

.tp-hero-ticker-prefix {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-green);
  opacity: 0.85;
  flex-shrink: 0;
}

.tp-hero-ticker-viewport {
  display: inline-block;
  overflow: hidden;
  height: 22px;
  line-height: 22px;
  vertical-align: middle;
  position: relative;
}

.tp-hero-ticker-link {
  color: var(--brand-green);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.tp-hero-ticker-link:hover {
  text-decoration: underline;
  color: #0f5244;
}

.tp-hero-ticker-anim-out {
  transform: translateY(-20px);
  opacity: 0;
}

.tp-hero-ticker-anim-in {
  transform: translateY(20px);
  opacity: 0;
}

@keyframes tp-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.7);
  }
}

/* Hero Headline — editorial large serif */
.tp-hero-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* Italic serif accent like WisprFlow's "just speak" */
.tp-hero-title em {
  font-style: italic;
  color: var(--brand-green);
}

.tp-hero-subtitle {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto 36px;
}

/* Hero Search Box */
.tp-hero-search {
  position: relative;
  max-width: 580px;
  margin: 0 auto 28px;
}

.tp-hero-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.05rem;
  pointer-events: none;
}

.tp-hero-search-input {
  width: 100%;
  height: 56px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-pill);
  padding: 0 56px 0 50px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: var(--ease-normal);
}

.tp-hero-search-input::placeholder {
  color: var(--text-muted);
}

.tp-hero-search-input:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 4px rgba(26, 106, 88, 0.08), var(--shadow-sm);
}

.tp-hero-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--ease-fast);
  cursor: pointer;
}

.tp-hero-search-clear:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

/* Trust Bar — Strict Single Horizontal Row */
.tp-trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: nowrap;
  margin-top: 14px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tp-trust-bar::-webkit-scrollbar {
  display: none;
}

.tp-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.tp-trust-item .icon {
  width: 18px;
  height: 18px;
  background: var(--brand-green-lite);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-green);
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ==========================================================================
   CATEGORY NAVIGATION — Responsive Category Grid
   ========================================================================== */
.tp-category-section {
  padding: 24px 0 36px;
  background: var(--bg-page);
  border-bottom: none;
}

.tp-category-grid,
.tp-category-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 1024px) and (min-width: 769px) {

  .tp-category-grid,
  .tp-category-pills {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tp-pill-btn,
.tp-cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  height: 52px;
  min-height: 52px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  transition: all var(--ease-fast);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  user-select: none;
}

.tp-cat-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.tp-pill-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand-green);
}

.tp-pill-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.tp-cat-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-pill-btn:hover,
.tp-cat-card:hover {
  color: var(--brand-green);
  border-color: var(--brand-green);
  background: var(--brand-green-lite);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.tp-pill-btn.active,
.tp-cat-card.active {
  color: #ffffff;
  background: var(--brand-green);
  border-color: var(--brand-green);
  box-shadow: var(--shadow-green);
}

.tp-pill-btn.active .tp-cat-name,
.tp-pill-btn.active .tp-pill-icon {
  color: #ffffff;
}

.tp-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  min-width: 26px;
  height: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: all var(--ease-fast);
}

.tp-pill-btn:not(.active) .tp-pill-count,
.tp-cat-card:not(.active) .tp-pill-count {
  background: var(--bg-input);
  color: var(--text-muted);
}

.tp-pill-btn.active .tp-pill-count,
.tp-cat-card.active .tp-pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Government Exam Tools Card */
.tp-cat-card[data-cat="govexam"] .tp-cat-name {
  font-size: 0.81rem;
}

@media (max-width: 768px) {
  .tp-cat-card[data-cat="govexam"] .tp-cat-name {
    font-size: 0.77rem !important;
  }
}

/* ==========================================================================
   TOOLS GRID SECTION
   ========================================================================== */
.tp-grid-section {
  padding: 36px 0 64px;
  background: var(--bg-page);
  scroll-margin-top: 76px;
}

.tp-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: none;
}

.tp-grid-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-grid-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.tp-grid-count {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--brand-green-lite);
  color: var(--brand-green);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
}

.tp-grid-reset-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--brand-green);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.tp-grid-reset-btn:hover {
  background: var(--brand-green-lite);
  border-color: var(--brand-green);
  transform: translateX(2px);
}

.tp-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Tool Card — clean editorial style */
.tp-tool-card {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  cursor: pointer;
  transition: var(--ease-spring);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

/* Top colored accent line */
.tp-tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--brand-green));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  opacity: 0;
  transition: opacity var(--ease-fast);
}

.tp-tool-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.tp-tool-card:hover::before {
  opacity: 1;
}

/* Card Icon Box — SVG-based */
.tp-card-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg, var(--brand-green-lite));
  flex-shrink: 0;
  transition: transform var(--ease-fast);
}

.tp-card-icon-box svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.tp-tool-card:hover .tp-card-icon-box {
  transform: scale(1.08) rotate(-4deg);
}

/* Card Content */
.tp-card-content {
  flex: 1;
}

.tp-card-name {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.tp-card-desc {
  font-family: var(--font-sans);
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Card Footer Tags */
.tp-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tp-card-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  letter-spacing: 0.02em;
}

/* Card Arrow — SVG */
.tp-card-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 32px;
  height: 32px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--ease-fast);
}

.tp-card-arrow svg {
  width: 14px;
  height: 14px;
  display: block;
}

.tp-tool-card:hover .tp-card-arrow {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #fff;
  transform: translate(2px, -2px);
}

/* Tool Card Share Button */
.tp-card-share-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 3;
  transition: all var(--ease-fast);
  padding: 0;
  outline: none;
}

.tp-card-share-btn:hover {
  background: var(--brand-green-lite);
  border-color: var(--brand-green);
  color: var(--brand-green);
  transform: scale(1.12);
  box-shadow: var(--shadow-xs);
}

.tp-card-share-btn:active {
  transform: scale(0.95);
}

.tp-card-share-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* Category pill icon */
.tp-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-pill-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* Workspace title icon */
.tp-ws-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 8px;
}

.tp-ws-title-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Command palette icon */
.tp-palette-item-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ==========================================================================
   WORKSPACE VIEW
   ========================================================================== */
#tp-workspace-view {
  display: none;
  padding: 32px 0 80px;
  flex: 1;
}

.tp-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: nowrap;
  gap: 12px;
}

.tp-btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--ease-fast);
}

.tp-btn-back:hover {
  color: var(--text-primary);
  border-color: var(--border-mid);
  background: var(--bg-warm);
  transform: translateX(-2px);
  box-shadow: var(--shadow-xs);
}

.tp-btn-feedback,
.tp-workspace-privacy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  border: 1.5px solid rgba(26, 106, 88, 0.22);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.tp-btn-feedback:hover,
.tp-workspace-privacy-icon:hover {
  transform: scale(1.08);
  background: rgba(26, 106, 88, 0.16);
  border-color: var(--brand-green);
  box-shadow: var(--shadow-xs);
  color: var(--brand-green);
}

[data-theme="dark"] .tp-btn-feedback,
[data-theme="dark"] .tp-workspace-privacy-icon {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
  color: #34d399;
}

[data-theme="dark"] .tp-btn-feedback:hover,
[data-theme="dark"] .tp-workspace-privacy-icon:hover {
  background: rgba(52, 211, 153, 0.2);
  border-color: #34d399;
  color: #34d399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.tp-footer-feedback-link {
  color: var(--brand-green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.tp-footer-feedback-link:hover {
  opacity: 0.8;
}

.tp-workspace-privacy-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(26, 106, 88, 0.2);
}

/* Full-Focus Studio Mode: hide navbar when a tool is opened */
body.tp-tool-active .tp-navbar {
  display: none !important;
}

body.tp-tool-active #tp-workspace-view {
  padding-top: 18px;
}

.tp-workspace-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.tp-btn-share:hover {
  background: var(--brand-green-lite);
  border-color: var(--brand-green);
  color: var(--brand-green);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.tp-btn-share:active {
  transform: translateY(0);
}

.tp-btn-share svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.tp-workspace-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-2xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.tp-workspace-title-box {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.tp-workspace-title-box h1 {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

.tp-workspace-title-box p,
#ws-tool-desc {
  display: none !important;
}

/* ==========================================================================
   FORM ELEMENTS — Clean inputs
   ========================================================================== */
.tp-tool-inner {
  max-width: 800px;
  margin: 0 auto;
}

.tp-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  outline: none;
  transition: var(--ease-fast);
}

.tp-input:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(26, 106, 88, 0.1);
  background: var(--bg-card);
}

.tp-form-group {
  margin-bottom: 18px;
}

.tp-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.tp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ==========================================================================
   UNIVERSAL RANGE SLIDER STYLING — Premium, Perfectly Aligned Across All Tools
   ========================================================================== */
.tp-range,
.tp-slider,
.tp-sip-slider,
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 40px;
  background: transparent;
  cursor: pointer;
  margin: 0;
  padding: 0;
  display: block;
  outline: none;
}

/* Track — Webkit */
.tp-range::-webkit-slider-runnable-track,
.tp-slider::-webkit-slider-runnable-track,
.tp-sip-slider::-webkit-slider-runnable-track,
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: var(--border-light, #e2e8f0);
  border-radius: var(--r-pill, 9999px);
  transition: background var(--ease-fast, 0.2s);
  border: none;
}

/* Track — Firefox */
.tp-range::-moz-range-track,
.tp-slider::-moz-range-track,
.tp-sip-slider::-moz-range-track,
input[type="range"]::-moz-range-track {
  width: 100%;
  height: 6px;
  background: var(--border-light, #e2e8f0);
  border-radius: var(--r-pill, 9999px);
  transition: background var(--ease-fast, 0.2s);
  border: none;
}

/* Thumb — Webkit */
.tp-range::-webkit-slider-thumb,
.tp-slider::-webkit-slider-thumb,
.tp-sip-slider::-webkit-slider-thumb,
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-green, #1a6a58);
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(26, 106, 88, 0.2);
  margin-top: -7px;
  /* (6px track - 20px thumb) / 2 = -7px to center thumb vertically */
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* Thumb — Firefox */
.tp-range::-moz-range-thumb,
.tp-slider::-moz-range-thumb,
.tp-sip-slider::-moz-range-thumb,
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-green, #1a6a58);
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(26, 106, 88, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}

/* Hover & Active / Focus States */
.tp-range:hover::-webkit-slider-thumb,
.tp-slider:hover::-webkit-slider-thumb,
.tp-sip-slider:hover::-webkit-slider-thumb,
input[type="range"]:hover::-webkit-slider-thumb,
.tp-range:hover::-moz-range-thumb,
.tp-slider:hover::-moz-range-thumb,
.tp-sip-slider:hover::-moz-range-thumb,
input[type="range"]:hover::-moz-range-thumb {
  transform: scale(1.15);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28), 0 0 0 4px rgba(26, 106, 88, 0.2);
  background: var(--brand-green-mid, #134e42);
}

.tp-range:active::-webkit-slider-thumb,
.tp-slider:active::-webkit-slider-thumb,
.tp-sip-slider:active::-webkit-slider-thumb,
input[type="range"]:active::-webkit-slider-thumb,
.tp-range:active::-moz-range-thumb,
.tp-slider:active::-moz-range-thumb,
.tp-sip-slider:active::-moz-range-thumb,
input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.22);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 0 6px rgba(26, 106, 88, 0.28);
}

.tp-range:focus-visible,
.tp-slider:focus-visible,
.tp-sip-slider:focus-visible,
input[type="range"]:focus-visible {
  outline: none;
}

.tp-range:focus-visible::-webkit-slider-thumb,
.tp-slider:focus-visible::-webkit-slider-thumb,
.tp-sip-slider:focus-visible::-webkit-slider-thumb,
input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(26, 106, 88, 0.35);
}

/* Dark Theme Tracks & Thumbs */
[data-theme="dark"] .tp-range::-webkit-slider-runnable-track,
[data-theme="dark"] .tp-slider::-webkit-slider-runnable-track,
[data-theme="dark"] .tp-sip-slider::-webkit-slider-runnable-track,
[data-theme="dark"] input[type="range"]::-webkit-slider-runnable-track,
[data-theme="dark"] .tp-range::-moz-range-track,
[data-theme="dark"] .tp-slider::-moz-range-track,
[data-theme="dark"] .tp-sip-slider::-moz-range-track,
[data-theme="dark"] input[type="range"]::-moz-range-track {
  background: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .tp-range::-webkit-slider-thumb,
[data-theme="dark"] .tp-slider::-webkit-slider-thumb,
[data-theme="dark"] .tp-sip-slider::-webkit-slider-thumb,
[data-theme="dark"] input[type="range"]::-webkit-slider-thumb,
[data-theme="dark"] .tp-range::-moz-range-thumb,
[data-theme="dark"] .tp-slider::-moz-range-thumb,
[data-theme="dark"] .tp-sip-slider::-moz-range-thumb,
[data-theme="dark"] input[type="range"]::-moz-range-thumb {
  border-color: #1f2937;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Select */
.tp-select {
  width: 100%;
  padding: 11px 16px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  transition: var(--ease-fast);
}

.tp-select:focus {
  border-color: var(--brand-green);
}

/* Checkbox / Radio */
.tp-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-green);
  cursor: pointer;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--ease-fast);
  white-space: nowrap;
  border: 1.5px solid transparent;
  min-height: 42px;
  box-sizing: border-box;
}

.tp-btn svg {
  margin-right: 0 !important;
  flex-shrink: 0;
}

.tp-btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  min-height: 34px;
  gap: 5px;
}

.tp-btn-primary {
  background: var(--brand-green);
  color: #fff;
  border-color: var(--brand-green);
}

.tp-btn-primary:hover {
  background: var(--brand-green-mid);
  box-shadow: var(--shadow-green);
  transform: translateY(-1px);
}

.tp-btn-success {
  background: var(--brand-green);
  color: #fff;
  border-color: var(--brand-green);
}

.tp-btn-success:hover {
  background: var(--brand-green-mid);
  box-shadow: var(--shadow-green);
  transform: translateY(-1px);
}

.tp-btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-mid);
}

.tp-btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-mid);
  background: var(--bg-input);
}

.tp-btn-danger {
  background: transparent;
  color: #dc2626;
  border-color: #dc2626;
}

.tp-btn-danger:hover {
  background: #fef2f2;
}

[data-theme="dark"] .tp-btn-danger:hover {
  background: rgba(220, 38, 38, 0.18);
}

.tp-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.tp-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Presets chips */
.tp-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
}

.tp-chip {
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--ease-fast);
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  text-align: center;
  box-sizing: border-box;
}

.tp-chip:hover {
  background: var(--brand-green-lite);
  color: var(--brand-green);
  border-color: rgba(26, 106, 88, 0.3);
}

/* ==========================================================================
   DROPZONE — File Drop Area
   ========================================================================== */
.tp-dropzone {
  border: 2px dashed var(--border-mid);
  border-radius: var(--r-xl);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--ease-normal);
  background: var(--bg-surface-alt);
  position: relative;
  overflow: hidden;
}

.tp-dropzone::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(26, 106, 88, 0.04) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--ease-normal);
}

.tp-dropzone:hover,
.tp-dropzone.drag-over {
  border-color: var(--brand-green);
  background: var(--brand-green-lite);
}

.tp-dropzone:hover::after,
.tp-dropzone.drag-over::after {
  opacity: 1;
}

.tp-dropzone-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
}

.tp-dropzone h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tp-dropzone p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* ==========================================================================
   FILE LIST CARDS
   ========================================================================== */
.tp-file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  transition: var(--ease-fast);
}

.tp-file-card:hover {
  border-color: var(--border-mid);
}

.tp-file-icon {
  width: 40px;
  height: 40px;
  background: var(--brand-green-lite);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.tp-file-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  background: var(--bg-surface-alt);
}

.tp-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-file-name,
.tp-truncate-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  display: inline-block;
  vertical-align: middle;
}

.tp-file-size {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   PROGRESS & STATUS
   ========================================================================== */
.tp-progress {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin: 12px 0;
}

.tp-progress-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-green-mid));
  border-radius: var(--r-pill);
  transition: width 0.4s ease;
}

.tp-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--brand-green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(26, 106, 88, 0.2);
  animation: tp-pulse 2s ease infinite;
}

/* ==========================================================================
   COMMAND PALETTE — Quick launch (Ctrl+K)
   ========================================================================== */
.tp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px;
}

.tp-modal-backdrop.open {
  display: flex;
}

.tp-command-palette {
  background: var(--bg-card);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-2xl);
  width: 100%;
  max-width: 600px;
  max-height: 75vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: tp-palette-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tp-palette-in {
  from {
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.tp-palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.tp-palette-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  background: none;
  border: none;
  outline: none;
}

.tp-palette-input::placeholder {
  color: var(--text-muted);
}

.tp-palette-results {
  max-height: calc(75vh - 120px);
  overflow-y: auto;
  padding: 8px;
}

.tp-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: var(--ease-fast);
}

.tp-palette-item:hover,
.tp-palette-item.active {
  background: var(--brand-green-lite);
  color: var(--brand-green);
}

.tp-palette-item-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-input);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tp-palette-item-text strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tp-palette-item-text small {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.tp-palette-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.tp-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.tp-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 260px;
  max-width: 380px;
  animation: tp-toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tp-toast-in {
  from {
    transform: translateY(12px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.tp-toast.success {
  border-left: 4px solid var(--brand-green);
}

.tp-toast.error {
  border-left: 4px solid #dc2626;
}

.tp-toast.info {
  border-left: 4px solid var(--accent-blue);
}

.tp-toast.warning {
  border-left: 4px solid var(--accent-amber);
}

.tp-toast-icon {
  font-size: 1.1rem;
}

.tp-toast-msg {
  flex: 1;
}

.tp-toast-close {
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.tp-toast-close:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}


/* ==========================================================================
   TOOL-SPECIFIC STYLES
   ========================================================================== */

/* Audio Waveform Canvas */
.tp-waveform {
  width: 100%;
  height: 120px;
  border-radius: var(--r-lg);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  cursor: pointer;
  display: block;
}

/* Image Preview */
.tp-preview-img {
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  object-fit: contain;
}

/* Video preview */
.tp-preview-video {
  max-width: 100%;
  width: 100%;
  border-radius: var(--r-lg);
  background: #000;
  display: block;
}

/* Result card */
.tp-result-card {
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-top: 20px;
}

/* Dividers */
.tp-divider {
  width: 100%;
  height: 1px;
  background: var(--border-light);
  margin: 24px 0;
}

/* Info Banner */
.tp-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(59, 109, 240, 0.06);
  border: 1px solid rgba(59, 109, 240, 0.15);
  border-radius: var(--r-lg);
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.tp-success-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--brand-green-lite);
  border: 1px solid rgba(26, 106, 88, 0.2);
  border-radius: var(--r-lg);
  font-size: 0.86rem;
  color: var(--brand-green);
  line-height: 1.55;
  font-weight: 500;
}

/* Stat display boxes */
.tp-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.tp-stat-box {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 14px;
  text-align: center;
}

.tp-stat-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-green);
  line-height: 1;
  margin-bottom: 4px;
}

.tp-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   FOOTER — Editorial Design & Full Category Directory
   ========================================================================== */
.tp-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 64px 0 32px;
  margin-top: 64px;
  position: relative;
  z-index: 10;
}

.tp-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 36px;
  margin-bottom: 44px;
}

.tp-footer-col {
  display: flex;
  flex-direction: column;
}

.tp-footer-brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.tp-footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.tp-footer-brand-title {
  text-transform: none !important;
  letter-spacing: -0.01em !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin-bottom: 0 !important;
}

.tp-footer-brand-desc {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 10px 0 16px;
  max-width: 340px;
}

.tp-footer-brand-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tp-footer-feedback-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  border: 1px solid rgba(26, 106, 88, 0.22);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.tp-footer-feedback-chip:hover {
  transform: translateY(-1px);
  background: rgba(26, 106, 88, 0.16);
  border-color: var(--brand-green);
}

[data-theme="dark"] .tp-footer-feedback-chip {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
  color: #34d399;
}

[data-theme="dark"] .tp-footer-feedback-chip:hover {
  background: rgba(52, 211, 153, 0.2);
}

.tp-footer-col ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tp-footer-col li {
  list-style: none !important;
  line-height: 1.35;
}

.tp-footer-col a {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--ease-fast), transform var(--ease-fast);
  display: inline-block;
  cursor: pointer;
}

.tp-footer-col a:hover {
  color: var(--brand-green);
  transform: translateX(3px);
}

.tp-footer-trust-badge {
  font-size: 0.78rem;
  color: var(--brand-green);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-green-lite);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(26, 106, 88, 0.18);
  width: fit-content;
  white-space: nowrap;
}

[data-theme="dark"] .tp-footer-trust-badge {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.2);
  color: #34d399;
}

.tp-footer-product-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.tp-footer-product-pill .tp-dot-sep {
  color: var(--border-mid);
  font-size: 0.9em;
}

.tp-footer-main-link {
  color: var(--brand-green);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.18s ease;
}

.tp-footer-main-link:hover {
  text-decoration: underline;
  color: #145546;
  transform: translateY(-1px);
}

.tp-footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tp-footer-bottom p {
  margin: 0;
  line-height: 1.5;
}

.tp-footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-footer-site-link {
  color: var(--brand-green);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color 0.18s ease;
}

.tp-footer-site-link:hover {
  text-decoration: underline;
  color: #145546;
}

.tp-footer-feedback-link {
  color: var(--brand-green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.tp-footer-feedback-link:hover {
  opacity: 0.8;
}

/* ==========================================================================
   RESPONSIVE ENGINE — 100% Mobile Responsive Architecture
   Breakpoints:
     - 992px: Tablet Landscape
     - 768px: Tablet Portrait & Large Phones
     - 560px: Standard Mobile Phones
     - 380px: Compact Mobile Phones (320px - 380px)
   ========================================================================== */

/* Prevent horizontal overflow page-wide */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  box-sizing: border-box;
}

/* Ensure all media and canvases never overflow container */
canvas,
video,
audio,
img {
  max-width: 100%;
}

/* Base image preview responsiveness */
.tp-preview-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-md);
}

.tp-preview-video {
  max-width: 100%;
  width: 100%;
  border-radius: var(--r-md);
  background: #000;
}

/* PDF Editor & Reorder Visual Cards */
.tp-pdf-page-card {
  transition: transform var(--ease-fast), box-shadow var(--ease-fast), border-color var(--ease-fast);
}

.tp-pdf-page-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-green);
}

.tp-pdf-thumb-box {
  background: #f8fafc;
  transition: background var(--ease-fast), border-color var(--ease-fast);
}

[data-theme="dark"] .tp-pdf-thumb-box {
  background: #0f172a;
}

.tp-pdf-thumb-box:hover {
  border-color: var(--brand-green);
}

.tp-pdf-page-img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* --------------------------------------------------------------------------
   1. TABLET LANDSCAPE (<= 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .tp-tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
  }

  .tp-footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
  }

  .tp-footer-brand-col {
    grid-column: 1 / -1;
    max-width: 100%;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
  }

  .tp-footer-brand-desc {
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   NAVBAR RESPONSIVE & EXPANDED DESKTOP VIEW
   -------------------------------------------------------------------------- */
@media (min-width: 1600px) {
  .tp-navbar .tp-container {
    max-width: 1560px;
  }
}

@media (max-width: 1260px) and (min-width: 861px) {
  .tp-navbar .tp-container {
    padding: 0 16px;
  }

  .tp-nav-categories {
    gap: 4px;
  }

  .tp-nav-search {
    width: 180px;
    flex: 0 1 180px;
    min-width: 120px;
    margin-left: 8px;
    margin-right: auto;
  }

  .tp-nav-actions {
    gap: 2px;
  }

  .tp-nav-link {
    padding: 5px 7px;
    font-size: 0.8rem;
  }
}

/* --------------------------------------------------------------------------
   2. TABLET PORTRAIT & NAVBAR SWITCH (<= 860px)
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .tp-navbar {
    top: 10px;
    padding: 0 12px;
  }

  .tp-navbar .tp-container {
    padding: 0;
  }

  .tp-nav-inner {
    height: 52px;
    padding: 0 8px 0 6px;
    border-radius: 12px;
    gap: 6px;
  }

  /* Categories hidden on mobile */
  .tp-nav-categories {
    display: none !important;
  }

  .tp-nav-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 5px;
  }

  /* Extended Search Bar beside Logo on Mobile */
  .tp-nav-search {
    display: flex !important;
    flex: 1;
    width: auto;
    min-width: 60px;
    max-width: none;
    margin: 0 4px 0 0;
  }

  .tp-nav-search-btn {
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    gap: 6px;
  }

  [data-theme="dark"] .tp-nav-search-btn {
    background: rgba(255, 255, 255, 0.06);
  }

  .tp-nav-search-text {
    font-size: 0.8rem;
  }

  .tp-nav-search .tp-kbd-hint {
    display: none !important;
  }

  .tp-mobile-search-btn {
    display: none !important;
  }

  .tp-mobile-daily-btn {
    display: none !important;
  }

  .tp-nav-support-btn,
  .tp-nav-daily-bubble-btn,
  .tp-theme-toggle {
    display: flex !important;
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0;
  }

  .tp-nav-links-bar,
  .tp-navbar .tp-nav-actions .tp-nav-link,
  .tp-navbar .tp-nav-actions .tp-nav-dropdown {
    display: none;
  }

  .tp-brand-group {
    gap: 6px;
  }

  .tp-nav-link-daily {
    padding: 4px 10px;
    font-size: 0.76rem;
    height: 32px;
  }

  .tp-brand-wrap {
    padding: 2px 4px 2px 2px;
  }

  .tp-brand-logo {
    height: 38px;
    width: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .tp-brand-text {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .tp-nav-search {
    margin: 0 4px 0 0;
  }

  .tp-nav-search-btn {
    padding: 0 8px;
  }

  .tp-nav-search-text {
    font-size: 0.76rem;
  }

  .tp-brand-group {
    gap: 4px;
  }

  .tp-nav-link-daily {
    padding: 3px 8px;
    font-size: 0.72rem;
    height: 29px;
  }

  .tp-nav-actions {
    gap: 4px;
  }

  .tp-nav-support-btn,
  .tp-nav-daily-bubble-btn,
  .tp-theme-toggle {
    width: 32px !important;
    height: 32px !important;
  }
}

@media (max-width: 380px) {
  .tp-navbar {
    top: 6px;
    padding: 0 6px;
  }

  .tp-nav-inner {
    height: 48px;
    padding: 0 6px 0 4px;
    gap: 4px;
  }

  .tp-brand-logo {
    height: 30px;
  }

  .tp-brand-group {
    gap: 3px;
  }

  .tp-nav-link-daily {
    padding: 2px 6px;
    font-size: 0.68rem;
    height: 26px;
  }

  .tp-brand-text {
    font-size: 1.02rem;
  }

  .tp-nav-search-btn {
    height: 30px;
    padding: 0 6px;
  }

  .tp-nav-actions {
    gap: 3px;
  }

  .tp-theme-toggle,
  .tp-nav-daily-bubble-btn,
  .tp-nav-support-btn {
    width: 30px !important;
    height: 30px !important;
  }
}

@media (max-width: 1200px) {
  .tp-container {
    padding: 0 20px;
    box-sizing: border-box;
  }

  .tp-workspace-card {
    padding: 28px 22px;
  }
}

/* --------------------------------------------------------------------------
   3. TABLET & LARGE PHONES (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .tp-container {
    padding: 0 16px;
  }

  /* Mobile Footer */
  .tp-footer {
    padding: 40px 0 24px;
    margin-top: 48px;
  }

  .tp-footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 14px;
    margin-bottom: 28px;
  }

  .tp-footer-brand-col {
    grid-column: 1 / -1;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
  }

  .tp-footer-brand-header {
    gap: 10px;
  }

  .tp-footer-brand-title {
    font-size: 1rem !important;
  }

  .tp-footer-brand-desc {
    font-size: 0.82rem;
    margin: 8px 0 12px;
    line-height: 1.55;
    max-width: 100%;
  }

  .tp-footer-brand-badges {
    gap: 6px;
  }

  .tp-footer-trust-badge,
  .tp-footer-feedback-chip {
    font-size: 0.74rem;
    padding: 4px 10px;
  }

  .tp-footer-col h4 {
    font-size: 0.76rem;
    margin-bottom: 10px;
    letter-spacing: 0.06em;
  }

  .tp-footer-col ul {
    gap: 7px;
  }

  .tp-footer-col a {
    font-size: 0.82rem;
    padding: 2px 0;
    display: block;
  }

  .tp-footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding-top: 18px;
  }

  .tp-footer-bottom p {
    font-size: 0.78rem;
    line-height: 1.55;
    text-align: center;
  }

  .tp-footer-bottom-links {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px 8px !important;
    font-size: 0.8rem;
    text-align: center;
  }

  .tp-footer-bottom-links .tp-nav-link {
    display: inline-block !important;
    font-size: 0.82rem !important;
    padding: 4px 6px !important;
    color: var(--text-muted) !important;
  }

  /* Hero Section */
  .tp-hero {
    padding: 44px 0 32px;
  }

  .tp-hero-pill {
    margin-bottom: 20px;
    font-size: 0.72rem;
    padding: 4px 12px;
  }

  .tp-hero-title {
    font-size: clamp(2.35rem, 8.5vw, 3.4rem);
    line-height: 1.1;
    margin-bottom: 18px;
    word-break: break-word;
  }

  .tp-hero-subtitle {
    font-size: 0.98rem;
    padding: 0;
    margin-bottom: 24px;
    line-height: 1.6;
  }

  .tp-hero-search-input {
    height: 50px;
    font-size: 16px;
    /* Prevents auto-zoom on iOS Safari */
    padding: 0 42px 0 46px;
  }

  .tp-trust-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: center !important;
    gap: 12px !important;
    font-size: 0.74rem !important;
    margin-top: 14px !important;
    padding: 4px 6px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tp-trust-bar::-webkit-scrollbar {
    display: none;
  }

  .tp-trust-item {
    font-size: 0.74rem !important;
    gap: 4px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .tp-trust-item .icon {
    width: 15px !important;
    height: 15px !important;
  }

  /* Category Navigation Grid on Tablets/Phones: 2 Equal Columns */
  .tp-category-grid,
  .tp-category-pills {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 6px 0 !important;
    margin: 0 !important;
    overflow-x: visible !important;
    width: 100% !important;
  }

  .tp-pill-btn,
  .tp-cat-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 10px !important;
    border-radius: var(--r-md) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .tp-cat-card-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .tp-cat-name {
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .tp-pill-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
  }

  .tp-pill-icon svg {
    width: 16px !important;
    height: 16px !important;
  }

  .tp-pill-count {
    font-size: 0.7rem !important;
    min-width: 22px !important;
    height: 20px !important;
    padding: 1px 6px !important;
    flex-shrink: 0 !important;
  }

  /* In 2-column mobile view, last card sits in column 2 beside previous card (only odd count spans full width) */
  .tp-pill-btn:last-child,
  .tp-cat-card:last-child {
    grid-column: auto !important;
  }

  .tp-pill-btn:last-child:nth-child(odd),
  .tp-cat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  /* Workspace View */
  #tp-workspace-view {
    padding: 16px 0 48px;
  }

  .tp-workspace-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
  }

  .tp-workspace-card {
    padding: 22px 16px;
    border-radius: var(--r-xl);
  }

  .tp-workspace-title-box {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .tp-workspace-title-box h1 {
    font-size: 1.45rem;
    line-height: 1.25;
    word-break: break-word;
  }

  .tp-workspace-title-box p {
    font-size: 0.85rem;
  }

  /* Form Elements & Inputs */
  .tp-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tp-input,
  .tp-select,
  select,
  input[type="text"],
  input[type="number"] {
    font-size: 16px !important;
    /* Prevents mobile Safari zoom */
  }

  /* Dropzone */
  .tp-dropzone {
    padding: 36px 16px;
    border-radius: var(--r-lg);
  }

  .tp-dropzone h3 {
    font-size: 1rem;
  }

  .tp-dropzone p {
    font-size: 0.82rem;
    margin-bottom: 16px;
  }

  /* Command Palette Modal on Mobile */
  .tp-modal-backdrop {
    padding: 16px 12px;
    align-items: flex-end;
  }

  .tp-command-palette {
    max-height: 82vh;
    border-radius: var(--r-2xl) var(--r-2xl) var(--r-md) var(--r-md);
  }

  .tp-palette-search input {
    font-size: 16px !important;
  }

  .tp-palette-footer span:first-child kbd {
    display: none;
  }

  /* Toast Notifications */
  .tp-toast-container {
    left: 14px !important;
    right: 14px !important;
    bottom: 78px !important;
    /* Floats above bottom floating navigation dock */
    z-index: 100000 !important;
  }

  .tp-toast {
    min-width: unset;
    width: 100%;
    max-width: 100%;
  }

  /* Comparison Preview Boxes */
  #compress-preview-box>div {
    flex-direction: column !important;
    align-items: center !important;
    gap: 18px !important;
  }
}

/* --------------------------------------------------------------------------
   4. STANDARD MOBILE PHONES (<= 560px)
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {

  /* Tool Grid — 1 column clean cards */
  .tp-tools-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tp-tool-card {
    padding: 20px 16px;
  }

  .tp-card-tags {
    padding-right: 44px;
    /* Space for the absolute arrow button */
  }

  /* Tool Action Buttons Full-Width on Mobile for Thumb Tapping */
  .tp-tool-inner>div>div[style*="display:flex"][style*="justify-content:center"] {
    flex-direction: column !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  .tp-tool-inner>div>div[style*="display:flex"][style*="justify-content:center"] .tp-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 44px !important;
  }

  /* Presets & Chips wrap comfortably */
  .tp-presets {
    gap: 6px;
  }

  .tp-chip {
    font-size: 0.76rem;
    padding: 6px 12px;
    flex-shrink: 0;
  }

  /* Voice Recorder Timer */
  #rec-timer {
    font-size: clamp(2.2rem, 9vw, 3rem) !important;
  }

  /* Canvas Visualizers */
  #rec-visualizer,
  #aud-wave-canvas {
    width: 100% !important;
    max-width: 100% !important;
    height: 60px !important;
  }

  /* QR Code Canvas */
  #qr-canvas {
    max-width: 220px !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
  }

  /* Footer (<= 560px): preserve 2-column scanability */
  .tp-footer-grid {
    gap: 22px 12px;
  }
}

/* --------------------------------------------------------------------------
   5. COMPACT MOBILE PHONES (<= 380px, e.g. iPhone SE, 320px)
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
  .tp-container {
    padding: 0 12px;
  }

  /* Compact Phone Footer (<= 380px) */
  .tp-footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tp-footer-brand-badges {
    flex-direction: column;
    align-items: stretch;
  }

  .tp-footer-trust-badge,
  .tp-footer-feedback-chip {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .tp-brand-badge {
    display: none;
  }

  .tp-brand-name {
    font-size: 0.9rem;
  }

  .tp-hero-title {
    font-size: 2.15rem;
    line-height: 1.12;
  }

  .tp-hero-subtitle {
    font-size: 0.88rem;
  }

  .tp-hero-pill {
    font-size: 0.68rem;
    padding: 4px 10px;
    letter-spacing: 0.05em;
  }

  .tp-workspace-card {
    padding: 16px 12px;
  }

  .tp-workspace-title-box h1 {
    font-size: 1.25rem;
  }

  .tp-card-name {
    font-size: 0.94rem;
  }

  .tp-card-desc {
    font-size: 0.8rem;
  }

  .tp-trust-bar {
    font-size: 0.72rem;
    gap: 8px 12px;
  }
}

/* ==========================================================================
   NEW TOOLS STYLES: Calculator, AI Chatbot, Translator & Audio Merger
   ========================================================================== */

/* Calculator Keypad */
.tp-calc-btn {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease-fast);
  box-shadow: var(--shadow-xs);
  user-select: none;
}

.tp-calc-btn:hover {
  background: var(--bg-surface-alt);
  border-color: var(--border-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.tp-calc-btn:active {
  transform: translateY(1px);
}

.tp-calc-btn-func {
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.tp-calc-btn-sc-func {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  font-size: 0.9rem;
  font-weight: 600;
}

.tp-calc-btn-sc-func:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
}

.tp-calc-btn-op {
  background: rgba(26, 106, 88, 0.08);
  color: var(--brand-green);
  font-size: 1.25rem;
  font-weight: 700;
}

.tp-calc-btn-op:hover {
  background: rgba(26, 106, 88, 0.15);
  border-color: var(--brand-green);
}

.tp-calc-btn-danger {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  font-weight: 700;
}

.tp-calc-btn-danger:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: var(--danger);
}

.tp-calc-btn-equal {
  background: var(--brand-green);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.4rem;
  border: none;
}

.tp-calc-btn-equal:hover {
  background: var(--brand-green-mid);
  color: #ffffff;
  box-shadow: var(--shadow-green);
}

/* ==========================================================================
   TELUGU PUBLIC AI CITIZEN ASSISTANT - CHATGPT & CLAUDE STYLE UI
   ========================================================================== */

/* Fullscreen spacious canvas when AI assistant is active */
/* Fullscreen spacious canvas when AI assistant is active */
body.tp-ai-body-active {
  overflow: hidden;
}

body.tp-ai-body-active .tp-footer {
  display: none !important;
}

#tp-workspace-view.tp-ai-mode {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 24px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  animation: tp-ai-backdrop-in 0.22s ease-out;
}

[data-theme="dark"] #tp-workspace-view.tp-ai-mode {
  background: rgba(0, 0, 0, 0.68);
}

@keyframes tp-ai-backdrop-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }

  to {
    opacity: 1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

#tp-workspace-view.tp-ai-mode .tp-container {
  max-width: 960px;
  width: 100%;
  height: calc(100vh - 48px);
  max-height: 860px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: tp-ai-card-in 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tp-ai-card-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#tp-workspace-view.tp-ai-mode .tp-workspace-header {
  display: none !important;
  /* Hide external header on both desktop and mobile; Claude topbar handles all actions */
}

#tp-workspace-view.tp-ai-mode .tp-workspace-card {
  flex: 1;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  width: 100%;
  box-sizing: border-box;
}

#tp-workspace-view.tp-ai-mode .tp-workspace-title-box {
  display: none;
}

#tp-workspace-view.tp-ai-mode #tp-tool-container {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat container inside tool container */
.tp-claude-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

/* Avatar & Logo SVG resets (neutralizes inline SVG margins from App.uiIcons) */
.tp-claude-welcome-avatar svg,
.tp-claude-bot-avatar svg,
.tp-claude-topbar-logo svg,
.tp-claude-card-top svg {
  margin: 0 !important;
  display: block;
  flex-shrink: 0;
}

.tp-claude-welcome-avatar svg {
  width: 28px;
  height: 28px;
}

.tp-claude-topbar-logo svg {
  width: 18px;
  height: 18px;
}

.tp-claude-bot-avatar svg {
  width: 16px;
  height: 16px;
}

/* Minimalist Top Bar */
.tp-claude-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
  flex-shrink: 0;
  z-index: 10;
}

.tp-claude-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-claude-topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-green-lite);
  border: 1px solid rgba(26, 106, 88, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  overflow: hidden;
  padding: 2px;
  box-sizing: border-box;
}

.tp-claude-topbar-bot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tp-claude-topbar-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.tp-claude-topbar-title .tp-title-brand {
  font-weight: 800;
  color: var(--brand-green);
}

.tp-claude-badge-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-green-lite);
  color: var(--brand-green);
  border: 1px solid rgba(26, 106, 88, 0.2);
  letter-spacing: 0.02em;
}

.tp-claude-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dedicated Clear Button with RED icon */
.tp-claude-clear-btn {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.tp-claude-clear-btn svg {
  color: #ef4444 !important;
  stroke: #ef4444 !important;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.tp-claude-clear-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
  color: #dc2626;
}

.tp-claude-clear-btn:hover svg {
  transform: scale(1.15);
}

/* Dedicated Close Button */
.tp-claude-close-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.tp-claude-close-btn:hover {
  background: var(--bg-warm);
  border-color: var(--border-mid);
  color: var(--text-main);
}

.tp-claude-new-chat-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tp-claude-new-chat-btn:hover {
  background: var(--bg-warm);
  color: var(--brand-green);
  border-color: var(--brand-green);
}

/* English badge inside prompt cards */
.tp-card-tag-en {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  border: 1px solid rgba(26, 106, 88, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  display: inline-block;
  vertical-align: middle;
  letter-spacing: 0.01em;
}

/* Main Scrollable Canvas */
.tp-claude-canvas {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 10px 24px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* =====================================================
   HERO / WELCOME STATE (ChatGPT / Claude 4-Card Grid)
   ===================================================== */
.tp-claude-welcome-hero {
  max-width: 780px;
  width: 100%;
  margin: auto auto;
  /* Vertically and horizontally balanced on desktop */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  box-sizing: border-box;
  animation: tp-fade-in 0.3s ease-out;
}

.tp-claude-welcome-avatar {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 35%, var(--brand-green-lite) 40%, rgba(26, 106, 88, 0.08) 100%);
  border: 1.5px solid rgba(26, 106, 88, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 10px 28px rgba(26, 106, 88, 0.14);
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
}

.tp-claude-welcome-bot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
  animation: tp-bot-float 3s ease-in-out infinite;
}

@keyframes tp-bot-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.tp-claude-welcome-title {
  font-family: var(--font-telugu), system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.35;
}

.tp-claude-welcome-desc {
  font-family: var(--font-telugu), system-ui, sans-serif;
  font-size: 0.94rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* 2x2 Prompt Cards Grid */
.tp-claude-prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 780px;
  box-sizing: border-box;
}

.tp-claude-prompt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
}

.tp-claude-prompt-card:hover {
  border-color: var(--brand-green);
  background: var(--card-bg);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 106, 88, 0.12);
}

.tp-claude-prompt-card:active {
  transform: scale(0.98);
}

.tp-claude-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-green);
}

.tp-claude-card-title {
  font-family: var(--font-telugu), system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-main);
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tp-claude-card-desc {
  font-family: var(--font-telugu), system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* =====================================================
   ACTIVE CONVERSATION THREAD
   ===================================================== */
.tp-claude-thread {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  padding-bottom: 12px;
}

.tp-claude-msg {
  display: flex;
  width: 100%;
  animation: tp-fade-in 0.25s ease-out;
}

/* User Message: Clean, subtle, modern pill */
.tp-claude-msg.is-user {
  justify-content: flex-end;
  margin-bottom: 16px;
}

.tp-claude-bubble-user {
  max-width: 76%;
  padding: 11px 18px;
  border-radius: 18px 18px 4px 18px;
  background: #f1f5f9;
  color: #0f172a;
  font-family: var(--font-telugu), system-ui, sans-serif;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.6;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  word-break: break-word;
}

[data-theme="dark"] .tp-claude-bubble-user {
  background: #27272a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Bot Message: Open, borderless editorial typography */
.tp-claude-msg.is-bot {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin-bottom: 20px;
}

.tp-claude-bot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-green-lite);
  border: 1.5px solid rgba(26, 106, 88, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
  padding: 2px;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.tp-claude-bot-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tp-claude-bot-content {
  flex: 1;
  min-width: 0;
  font-family: var(--font-telugu), system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-main);
  word-break: break-word;
}

.tp-chat-bot-text {
  line-height: 1.75;
}

.tp-chat-bot-text strong {
  color: var(--text-main);
  font-weight: 700;
}

/* Response Section Headings */
.tp-chat-h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-green);
  margin: 14px 0 6px;
  line-height: 1.4;
}

.tp-chat-h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 12px 0 4px;
  line-height: 1.4;
}

.tp-chat-section-label {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--brand-green);
  margin: 14px 0 6px;
  line-height: 1.45;
}

/* Guard against rogue margins inside list items */
.tp-chat-list-item .tp-chat-section-label {
  margin: 0 0 4px 0 !important;
  display: inline-block !important;
  line-height: inherit !important;
}

/* Bullet & Numbered List Items */
.tp-chat-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  line-height: 1.65;
}

.tp-chat-bullet-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
  margin-top: 10px;
  flex-shrink: 0;
  display: inline-block;
}

.tp-chat-num {
  font-weight: 700;
  color: var(--brand-green);
  min-width: 24px;
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
  padding: 0;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.tp-chat-text {
  flex: 1;
  min-width: 0;
  line-height: 1.65;
  word-break: break-word;
}

.tp-chat-text strong,
.tp-chat-item-title {
  color: var(--brand-green);
  font-weight: 700;
  display: inline;
  line-height: inherit;
}

.tp-chat-item-desc {
  margin-top: 3px;
  line-height: 1.65;
  color: var(--text-main);
}

.tp-chat-para {
  margin: 8px 0;
  line-height: 1.65;
}

.tp-chat-divider {
  border: 0;
  border-top: 1px solid var(--border-light);
  margin: 10px 0;
}

/* Article Link Badges */
.tp-chat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  border: 1px solid rgba(26, 106, 88, 0.24);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 5px 0;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.4;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.tp-chat-link:hover {
  background: var(--brand-green);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 106, 88, 0.2);
}

.tp-link-arr {
  font-size: 0.9em;
  font-weight: 700;
}

/* Response Footer (Label & Copy) */
.tp-claude-bot-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 6px;
}

.tp-claude-bot-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.tp-claude-copy-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.tp-claude-copy-btn svg {
  width: 12px !important;
  height: 12px !important;
  margin: 0 !important;
  display: block;
}

.tp-claude-copy-btn:hover {
  background: var(--bg-warm);
  color: var(--brand-green);
  border-color: var(--brand-green);
}

/* Typing Indicator Animation */
.tp-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
}

.tp-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
  opacity: 0.4;
  animation: tp-typing-bounce 1.4s infinite ease-in-out both;
}

.tp-typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.tp-typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes tp-typing-bounce {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}

/* =====================================================
   BOTTOM FLOATING PILL PROMPT BAR
   ===================================================== */
.tp-claude-input-container {
  padding: 12px 24px 16px 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--bg-card) 24%);
  flex-shrink: 0;
  z-index: 10;
  box-sizing: border-box;
}

.tp-claude-pill-box {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  padding: 6px 8px 6px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.tp-claude-pill-box:focus-within {
  border-color: rgba(26, 106, 88, 0.35);
  box-shadow: 0 4px 14px rgba(26, 106, 88, 0.08);
}

.tp-claude-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-family: var(--font-telugu), system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 8px 0;
  -webkit-appearance: none;
  appearance: none;
}

.tp-claude-input:focus,
.tp-claude-input:focus-visible {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.tp-claude-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--brand-green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(26, 106, 88, 0.25);
}

.tp-claude-send-btn:hover {
  background: var(--brand-green-mid);
  transform: scale(1.05);
}

.tp-claude-send-btn:active {
  transform: scale(0.94);
}

.tp-claude-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: var(--font-telugu), system-ui, sans-serif;
}

/* =====================================================
   MOBILE VIEWPORT REFINEMENTS (<640px)
   ===================================================== */
@media (max-width: 640px) {
  #trans-boxes-grid {
    grid-template-columns: 1fr !important;
  }

  .tp-calc-btn {
    height: 44px;
    font-size: 1.05rem;
  }

  body.tp-ai-body-active {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body.tp-ai-body-active .tp-navbar,
  body.tp-ai-body-active .tp-footer {
    display: none !important;
  }

  #tp-workspace-view.tp-ai-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 1000;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--bg-card);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
  }

  #tp-workspace-view.tp-ai-mode .tp-container {
    padding: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    animation: none !important;
  }

  #tp-workspace-view.tp-ai-mode .tp-workspace-header {
    display: none;
    /* Merged into topbar */
  }

  #tp-workspace-view.tp-ai-mode .tp-workspace-card {
    border: none;
    border-radius: 0;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    box-shadow: none;
  }

  .tp-claude-topbar {
    padding: 8px 12px;
    gap: 8px;
  }

  .tp-claude-topbar-left {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .tp-claude-topbar-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .tp-claude-topbar-title {
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 6px;
  }

  .tp-claude-badge-pill {
    font-size: 0.62rem;
    padding: 1px 6px;
  }

  .tp-claude-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .tp-claude-clear-btn,
  .tp-claude-close-btn {
    padding: 5px 9px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .tp-claude-canvas {
    padding: 12px 10px 8px 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .tp-claude-welcome-hero {
    margin: 0 auto;
    padding: 18px 6px 16px 6px;
    width: 100%;
    box-sizing: border-box;
  }

  .tp-claude-welcome-avatar {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    margin-bottom: 12px;
    padding: 4px;
  }

  .tp-claude-welcome-title {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 6px;
  }

  .tp-claude-welcome-desc {
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 16px;
    padding: 0 4px;
  }

  .tp-claude-prompt-grid {
    grid-template-columns: 1fr;
    gap: 9px;
    width: 100%;
    box-sizing: border-box;
  }

  .tp-claude-prompt-card {
    padding: 11px 13px;
    border-radius: 12px;
    box-sizing: border-box;
    width: 100%;
  }

  .tp-claude-card-title {
    font-size: 0.88rem;
  }

  .tp-claude-card-desc {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  .tp-claude-thread {
    width: 100%;
    gap: 12px;
    box-sizing: border-box;
  }

  .tp-claude-msg {
    width: 100%;
    box-sizing: border-box;
  }

  .tp-claude-msg.is-bot {
    gap: 8px;
    align-items: flex-start;
  }

  .tp-claude-bot-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    margin-top: 2px;
    padding: 1px;
  }

  .tp-claude-bubble-user {
    max-width: 88%;
    font-size: 0.88rem;
    padding: 9px 13px;
    border-radius: 16px 16px 3px 16px;
    line-height: 1.55;
    box-sizing: border-box;
  }

  .tp-claude-bot-content {
    min-width: 0;
    max-width: 100%;
    font-size: 0.9rem;
    line-height: 1.68;
    box-sizing: border-box;
  }

  .tp-claude-input-container {
    padding: 8px 10px max(10px, env(safe-area-inset-bottom, 10px)) 10px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    width: 100%;
    box-sizing: border-box;
  }

  .tp-claude-pill-box {
    border-radius: 24px;
    padding: 3px 5px 3px 13px;
    width: 100%;
    box-sizing: border-box;
  }

  .tp-claude-input {
    font-size: 0.88rem;
    padding: 6px 0;
  }

  .tp-claude-send-btn {
    width: 36px;
    height: 36px;
  }

  .tp-claude-disclaimer {
    font-size: 0.65rem;
    margin-top: 4px;
  }
}

/* ==========================================================================
   TELUGU TYPOGRAPHY & MANDALI FONT RULES
   ========================================================================== */
:lang(te),
[lang="te"],
.tp-telugu,
.tp-telugu-text {
  font-family: var(--font-telugu) !important;
  line-height: 1.75;
}

/* Ensure Telugu text in chatbot, translation, and suggestion chips renders with Mandali */
#tp-chat-messages,
#tp-chat-input,
#trans-input,
#trans-output,
.tp-chip-btn,
.tp-footer-brand-desc,
.tp-tool-inner {
  font-family: 'Figtree', 'Mandali', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Enhanced font sizing for Telugu script readability */
#tp-chat-messages strong,
#tp-chat-messages p,
#trans-output {
  font-family: 'Figtree', 'Mandali', sans-serif;
  letter-spacing: 0.01em;
}

/* ==========================================================================
   FORM CONTROLS & EDITORIAL STUDIO PANELS
   ========================================================================== */
.tp-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.tp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Universal text inputs, selects, and textareas */
.tp-input,
.tp-select,
.tp-textarea,
input[type="text"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="email"],
textarea,
select {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast), background-color var(--ease-fast);
  -webkit-appearance: none;
  appearance: none;
}

.tp-input:focus,
.tp-select:focus,
.tp-textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(26, 106, 88, 0.12);
  background-color: var(--bg-surface);
}

[data-theme="dark"] .tp-input:focus,
[data-theme="dark"] .tp-select:focus,
[data-theme="dark"] .tp-textarea:focus {
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.tp-input::placeholder,
.tp-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

/* Custom Styled Select Dropdown with SVG Chevron */
.tp-select {
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231a6a58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  line-height: 1.4;
}

[data-theme="dark"] .tp-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Standalone Textarea */
.tp-textarea {
  min-height: 140px;
  line-height: 1.65;
  resize: vertical;
}

.tp-textarea:read-only {
  background-color: var(--bg-surface-alt);
  cursor: default;
}

/* High-End Editorial Studio Panel (Framed Box with Header, Body, Footer) */
.tp-panel-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.tp-panel-box:focus-within {
  border-color: var(--brand-green);
  box-shadow: var(--shadow-md);
}

.tp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
}

.tp-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tp-panel-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--brand-green-lite);
  color: var(--brand-green);
}

.tp-panel-textarea {
  width: 100%;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 14px 16px;
  font-size: 0.96rem;
  line-height: 1.68;
  outline: none !important;
  resize: vertical;
  color: var(--text-primary);
  min-height: 170px;
  font-family: inherit;
}

.tp-panel-textarea:read-only {
  background: var(--bg-surface-alt) !important;
}

.tp-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface-alt);
  gap: 8px;
  flex-wrap: wrap;
}

.tp-panel-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tp-panel-footer-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Universal File Viewer & Hex Inspector Styles
   ========================================================================== */
.tp-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.tp-checkerboard {
  background-color: var(--bg-surface-alt);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.04) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

[data-theme="dark"] .tp-checkerboard {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
}

.tp-code-viewer {
  display: flex;
  max-height: 600px;
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  overflow: auto;
  background: var(--bg-card);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

.tp-code-gutter {
  padding: 14px 10px;
  background: var(--bg-surface-alt);
  border-right: 1px solid var(--border-light);
  color: var(--text-muted);
  text-align: right;
  user-select: none;
  min-width: 48px;
  font-size: 0.8rem;
}

.tp-code-content {
  flex: 1;
  padding: 14px 18px;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.tp-highlight {
  background-color: #fef08a;
  color: #854d0e;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

[data-theme="dark"] .tp-highlight {
  background-color: #854d0e;
  color: #fef08a;
}

.tp-csv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: var(--bg-card);
  text-align: left;
}

.tp-csv-table th {
  position: sticky;
  top: 0;
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border-mid);
  white-space: nowrap;
  z-index: 2;
}

.tp-csv-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-csv-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.tp-csv-table tbody tr:nth-child(even) {
  background: var(--bg-surface-alt);
}

/* ==========================================================================
   Word Document (.docx / .doc) Paper Styling
   ========================================================================== */
.tp-doc-paper-wrap {
  background: var(--bg-surface-alt);
  padding: 36px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  max-height: 720px;
  overflow-y: auto;
}

.tp-doc-paper {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 56px 64px;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  line-height: 1.8;
  font-size: 0.98rem;
  font-family: var(--font-sans);
}

.tp-doc-paper h1,
.tp-doc-paper h2,
.tp-doc-paper h3,
.tp-doc-paper h4 {
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.tp-doc-paper h1 {
  font-size: 1.8rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.tp-doc-paper h2 {
  font-size: 1.4rem;
}

.tp-doc-paper h3 {
  font-size: 1.18rem;
}

.tp-doc-paper p {
  margin-bottom: 14px;
}

.tp-doc-paper table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border: 1px solid var(--border-mid);
}

.tp-doc-paper th,
.tp-doc-paper td {
  padding: 9px 12px;
  border: 1px solid var(--border-light);
  font-size: 0.92rem;
}

.tp-doc-paper th {
  background: var(--bg-surface-alt);
  font-weight: 700;
}

.tp-doc-paper ul,
.tp-doc-paper ol {
  margin: 12px 0 16px 24px;
  padding-left: 8px;
}

.tp-doc-paper li {
  margin-bottom: 6px;
}

.tp-doc-paper img {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   PowerPoint (.pptx / .ppt) Slide Deck Styling
   ========================================================================== */
.tp-slide-screen-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.tp-slide-screen {
  width: 100%;
  max-width: 900px;
  min-height: 480px;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 44px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.tp-slide-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tp-slide-bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.tp-slide-bullet-icon {
  color: var(--brand-green);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1.2;
}

.tp-slide-deck-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 4px;
  scrollbar-width: thin;
}

.tp-slide-thumb {
  min-width: 140px;
  max-width: 160px;
  height: 80px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.tp-slide-thumb:hover {
  border-color: var(--brand-green-mid);
  transform: translateY(-2px);
}

.tp-slide-thumb.active {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 2px var(--brand-green-lite), var(--shadow-sm);
  background: var(--bg-surface);
}

.tp-slide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-height: 650px;
  overflow-y: auto;
  padding: 6px;
}

.tp-slide-grid-card:hover {
  border-color: var(--brand-green);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* ==========================================================================
   UNIVERSAL PRINT & PDF EXPORT SYSTEM (Zero Blank Pages)
   ========================================================================== */
@media print {

  /* 1. If Document Viewer is specifically printing a Word/Text paper */
  body.tp-printing-doc * {
    visibility: hidden;
  }

  body.tp-printing-doc #viewer-doc-paper,
  body.tp-printing-doc #viewer-doc-paper * {
    visibility: visible;
  }

  body.tp-printing-doc #viewer-doc-paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    box-shadow: none;
    border: none;
  }

  /* 2. Universal Clean-Up: Hide non-printable navigation, sliders & UI chrome */
  .tp-navbar,
  .tp-footer,
  .tp-progress-bar,
  .tp-modal-backdrop,
  .tp-toast-container,
  .tp-workspace-header,
  .tp-workspace-privacy-icon,
  .tp-btn-feedback,
  .tp-btn-back,
  .tp-sip-actions,
  .tp-emi-presets,
  .tp-sip-nav,
  .tp-sip-chips,
  .tp-emi-schedule-toggle,
  .tp-card-arrow,
  button,
  .tp-btn,
  .tp-kbd-hint,
  .tp-presets,
  #emi-presets-bar,
  #sip-nav-tabs,
  #box-emi-prepay-content .tp-emi-presets,
  .tp-emi-strategy-group,
  .tp-sip-slider,
  input[type="range"] {
    display: none !important;
  }

  /* 3. Base Paper & Typography Reset for Pristine PDF / Physical Print */
  @page {
    size: A4 portrait;
    margin: 12mm 10mm 12mm 10mm;
  }

  html,
  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 10.5pt !important;
    line-height: 1.45 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #tp-portal-view {
    display: none !important;
  }

  #tp-workspace-view {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .tp-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .tp-workspace-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .tp-workspace-title-box {
    margin-bottom: 14px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #1a6a58 !important;
  }

  .tp-workspace-title-box h1 {
    font-size: 17pt !important;
    color: #1a6a58 !important;
    margin: 0 0 4px !important;
  }

  .tp-workspace-title-box p {
    font-size: 9pt !important;
    color: #4b5563 !important;
    margin: 0 !important;
  }

  /* 4. Inputs & Parameter Badges (Display clean text values) */
  .tp-sip-val-badge {
    border: 1px solid #d1d5db !important;
    background: #f9fafb !important;
    padding: 2px 8px !important;
    font-size: 10pt !important;
    color: #1a6a58 !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
  }

  .tp-sip-val-badge input {
    border: none !important;
    background: transparent !important;
    color: #1a6a58 !important;
    font-size: 10pt !important;
    font-weight: 700 !important;
    width: auto !important;
    text-align: right !important;
  }

  /* 5. Tool Layout Grids */
  .tp-sip-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
    page-break-inside: avoid !important;
  }

  .tp-sip-card {
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    padding: 14px 16px !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
  }

  .tp-sip-field {
    margin-bottom: 10px !important;
  }

  .tp-sip-hero-stat {
    border: 1.5px solid #1a6a58 !important;
    background: #f0fdf4 !important;
    padding: 14px !important;
    border-radius: 8px !important;
    page-break-inside: avoid !important;
  }

  .tp-sip-hero-stat-val {
    font-size: 22pt !important;
    color: #1a6a58 !important;
    margin: 4px 0 !important;
  }

  .tp-sip-stats-row {
    gap: 8px !important;
    page-break-inside: avoid !important;
  }

  .tp-sip-stat-item {
    border: 1px solid #e5e7eb !important;
    background: #f9fafb !important;
    padding: 8px 10px !important;
    border-radius: 6px !important;
  }

  .tp-sip-stat-val {
    font-size: 11.5pt !important;
    color: #111827 !important;
  }

  .tp-sip-chart-box {
    padding: 6px 0 !important;
    page-break-inside: avoid !important;
  }

  .tp-sip-donut-svg {
    width: 125px !important;
    height: 125px !important;
  }

  .tp-sip-growth-chart-wrap {
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    padding: 12px !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
    margin-top: 12px !important;
  }

  /* 6. Amortization & Compounding Table (Full unclipped multi-page print) */
  .tp-sip-table-wrap {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    margin-top: 14px !important;
    box-shadow: none !important;
  }

  .tp-sip-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8.5pt !important;
    page-break-inside: auto !important;
  }

  .tp-sip-table thead {
    display: table-header-group !important;
  }

  .tp-sip-table th {
    background: #f3f4f6 !important;
    color: #1f2937 !important;
    font-weight: 700 !important;
    padding: 6px 8px !important;
    border-bottom: 2px solid #9ca3af !important;
    position: static !important;
  }

  .tp-sip-table tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  .tp-sip-table td {
    padding: 5px 8px !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: #111827 !important;
    background: #ffffff !important;
  }

  .tp-sip-table tr:nth-child(even) td {
    background: #f9fafb !important;
  }

  .tp-sip-magic-box,
  .tp-emi-savings-banner {
    border: 1px solid #f59e0b !important;
    background: #fffbeb !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    page-break-inside: avoid !important;
  }

  /* 7. Dark Mode Overrides (Prevent inverted / washed out colors during print) */
  [data-theme="dark"] body,
  [data-theme="dark"] .tp-workspace-card,
  [data-theme="dark"] .tp-sip-card,
  [data-theme="dark"] .tp-sip-table-wrap,
  [data-theme="dark"] .tp-sip-growth-chart-wrap {
    background: #ffffff !important;
    color: #111827 !important;
  }

  [data-theme="dark"] .tp-sip-hero-stat-val {
    color: #1a6a58 !important;
  }

  [data-theme="dark"] .tp-sip-stat-val,
  [data-theme="dark"] .tp-sip-table th,
  [data-theme="dark"] .tp-sip-table td,
  [data-theme="dark"] .tp-sip-label {
    color: #111827 !important;
  }

  [data-theme="dark"] * {
    text-shadow: none !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS: Universal Viewer, Word, PPT & Unlock PDF
   ========================================================================== */
@media (max-width: 768px) {

  /* Document Paper on Tablets */
  .tp-doc-paper-wrap {
    padding: 24px 12px;
  }

  .tp-doc-paper {
    padding: 36px 28px;
    font-size: 0.95rem;
  }

  /* Slide Presentation Screen on Tablets */
  .tp-slide-screen {
    padding: 28px 24px;
    min-height: 400px;
  }

  .tp-slide-screen h2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 640px) {

  /* Universal Viewer Toolbar */
  .tp-viewer-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 12px !important;
    gap: 10px !important;
  }

  .tp-viewer-toolbar>div {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: flex-start !important;
  }

  .tp-viewer-search-group {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .tp-viewer-search-box {
    flex: 1 !important;
    width: 100% !important;
    position: relative !important;
  }

  .tp-viewer-search-box input {
    width: 100% !important;
    font-size: 16px !important;
    /* Prevents auto-zoom on iOS */
  }

  /* Word Document Paper on Phones */
  .tp-doc-paper-wrap {
    padding: 10px 4px !important;
    border-radius: var(--r-sm) !important;
    max-height: 65vh !important;
  }

  .tp-doc-paper {
    padding: 20px 14px !important;
    box-shadow: none !important;
    border: none !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
    border-radius: 4px !important;
  }

  .tp-doc-paper h1 {
    font-size: 1.35rem !important;
    margin-top: 16px !important;
  }

  .tp-doc-paper h2 {
    font-size: 1.18rem !important;
    margin-top: 14px !important;
  }

  .tp-doc-paper h3 {
    font-size: 1.05rem !important;
  }

  .tp-doc-paper table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }

  .tp-doc-paper ul,
  .tp-doc-paper ol {
    margin: 8px 0 12px 14px !important;
    padding-left: 4px !important;
  }

  /* PowerPoint Presentation on Phones */
  .tp-slide-screen-wrap {
    margin-bottom: 12px !important;
  }

  .tp-slide-screen {
    aspect-ratio: auto !important;
    min-height: unset !important;
    padding: 18px 14px !important;
    border-radius: var(--r-md) !important;
    box-shadow: var(--shadow-md) !important;
  }

  .tp-slide-screen h2 {
    font-size: 1.22rem !important;
    line-height: 1.3 !important;
    margin-bottom: 14px !important;
  }

  .tp-slide-content-layout {
    flex-direction: column !important;
    gap: 14px !important;
    overflow: visible !important;
  }

  .tp-slide-text-col {
    padding-right: 0 !important;
    overflow-y: visible !important;
  }

  .tp-slide-media-col {
    width: 100% !important;
    max-width: 100% !important;
  }

  .tp-slide-img {
    max-height: 180px !important;
    margin: 0 auto;
    display: block;
  }

  .tp-slide-bullet-list li {
    font-size: 0.92rem !important;
    margin-bottom: 10px !important;
    line-height: 1.5 !important;
    gap: 8px !important;
  }

  .tp-slide-bullet-icon {
    font-size: 1.1rem !important;
  }

  .tp-slide-deck-strip {
    gap: 8px !important;
    padding: 8px 2px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .tp-slide-thumb {
    min-width: 110px !important;
    max-width: 125px !important;
    height: 66px !important;
    padding: 6px 8px !important;
  }

  .tp-slide-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Code & Text Viewer on Phones */
  .tp-code-viewer {
    max-height: 480px !important;
  }

  .tp-code-gutter {
    min-width: 32px !important;
    padding: 10px 4px !important;
    font-size: 0.72rem !important;
  }

  .tp-code-content {
    padding: 10px 12px !important;
    font-size: 0.78rem !important;
    line-height: 1.5 !important;
  }

  /* Hex Dump Inspector on Phones */
  .tp-code-viewer pre {
    font-size: 0.68rem !important;
    line-height: 1.45 !important;
    white-space: pre !important;
    word-break: normal !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* CSV Table Mobile Optimization */
  .tp-csv-table {
    font-size: 0.78rem !important;
  }

  .tp-csv-table th,
  .tp-csv-table td {
    padding: 8px 10px !important;
  }

  /* PDF Mobile Iframe */
  #viewer-dynamic-area iframe {
    height: 65vh !important;
    min-height: 380px !important;
  }

  /* Image Viewer Checkerboard on Mobile */
  .tp-checkerboard {
    padding: 16px 8px !important;
    max-height: 380px !important;
  }

  /* File Card Metadata on Mobile */
  .tp-file-card {
    flex-wrap: wrap !important;
    gap: 12px !important;
    padding: 14px !important;
  }

  .tp-file-info {
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }

  .tp-file-name,
  .tp-truncate-name {
    font-size: 0.88rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 200px !important;
    display: inline-block !important;
    vertical-align: middle !important;
  }

  /* Unlock PDF on Mobile */
  #pdf-unlock-controls .tp-card {
    padding: 18px 14px !important;
  }

  #pdf-unlock-password {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   IN-BROWSER PDF CONTENT EDITOR (Text, Image, Signature, Whiteout)
   ========================================================================== */
.tp-pdf-edit-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-green-lite);
  color: var(--brand-green);
  border: 1px solid rgba(26, 106, 88, 0.22);
  padding: 3px 8px;
  border-radius: var(--r-pill, 999px);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  line-height: 1;
  pointer-events: none;
}

[data-theme="dark"] .tp-pdf-edit-badge {
  border-color: rgba(52, 211, 153, 0.35);
}

.tp-pdf-edit-badge svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
  flex-shrink: 0;
}


.tp-pdf-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: tp-fade-in 0.2s ease;
}

.tp-pdf-editor-container {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 1060px;
  height: 94vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.tp-pdf-editor-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  flex-shrink: 0;
  gap: 12px;
}

.tp-pdf-editor-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tp-pdf-header-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-pdf-header-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.tp-pdf-editor-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tp-pdf-zoom-controls {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border-mid);
  overflow: hidden;
  padding: 0;
  gap: 0;
}

.tp-pdf-zoom-controls .tp-btn {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  height: 28px !important;
  padding: 2px 8px !important;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tp-pdf-zoom-controls .tp-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="dark"] .tp-pdf-zoom-controls .tp-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.tp-zoom-badge {
  font-size: 0.74rem;
  font-weight: 700;
  min-width: 40px;
  padding: 0 4px;
  text-align: center;
  color: var(--text-primary);
  user-select: none;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  line-height: 28px;
  height: 28px;
}

.tp-pdf-editor-toolbar {
  padding: 8px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.tp-pdf-toolbar-row-main {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.tp-pdf-toolbar-row-main::-webkit-scrollbar {
  height: 3px;
}

.tp-pdf-toolbar-row-main::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
}

.tp-pdf-toolbar-row-options {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg-surface);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.tp-pdf-toolbar-row-options select {
  height: 32px;
  padding: 4px 8px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--border-mid);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}

.tp-pdf-toolbar-row-options select#tp-ann-font-family {
  min-width: 140px;
  max-width: 175px;
}

.tp-pdf-toolbar-row-options select#tp-ann-font-size {
  width: 72px;
  min-width: 65px;
}

.tp-pdf-toolbar-row-options input[type="text"] {
  height: 32px;
  padding: 4px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--border-mid);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  flex: 1 1 140px;
  min-width: 110px;
  box-sizing: border-box;
}

.tp-pdf-editor-toolbar .tp-btn {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tp-pdf-workspace-area {
  flex: 1;
  overflow: auto;
  background: #cbd5e1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 48px 16px;
  -webkit-overflow-scrolling: touch;
  position: relative;
  touch-action: pan-x pan-y;
}

[data-theme="dark"] .tp-pdf-workspace-area {
  background: #1e293b;
}

.tp-pdf-stage-wrapper {
  transform-origin: top center;
  transition: none;
  /* Immediate transform eliminates intermediate blit scanlines */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 0 auto;
  flex-shrink: 0;
}

.tp-pdf-page-stage {
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  background: #ffffff;
  border-radius: 0;
  /* Flat page edge eliminates subpixel anti-aliasing seam lines */
  border: none !important;
  outline: none !important;
  line-height: 0;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.tp-pdf-page-stage canvas,
#tp-editor-page-canvas {
  display: block;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  image-rendering: auto;
  /* Clean bilinear rendering prevents moiré & dashed line cracks */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.tp-pdf-overlay-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  line-height: 1;
  touch-action: pan-x pan-y;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
}

.tp-ann-item {
  position: absolute;
  box-sizing: border-box;
  touch-action: none;
  z-index: 10;
  cursor: move;
}

.tp-ann-item.active,
.tp-ann-item.is-selected {
  outline: 1.5px solid var(--brand-green, #10a36b);
  outline-offset: 1px;
  box-shadow: 0 0 0 2px rgba(16, 163, 107, 0.18);
  z-index: 20;
  cursor: move;
}

.tp-ann-drag-bar {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  border-radius: 6px;
  padding: 3px 5px;
  font-size: 0.74rem;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  user-select: none;
  -webkit-user-select: none;
  z-index: 30;
  cursor: move;
}

.tp-ann-item.active .tp-ann-drag-bar,
.tp-ann-item.is-selected .tp-ann-drag-bar {
  display: flex;
}

.tp-ann-drag-bar.tp-bar-flip-bottom {
  bottom: auto;
  top: calc(100% + 7px);
}

.tp-ann-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #cbd5e1;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.tp-ann-drag-handle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
}

.tp-ann-drag-handle:active {
  cursor: grabbing;
}

.tp-ann-drag-bar button {
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 5px;
  min-width: 24px;
  height: 24px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.74rem;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.tp-ann-drag-bar button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tp-ann-drag-bar button svg,
.tp-ann-drag-handle svg {
  width: 13px;
  height: 13px;
  margin: 0 !important;
  vertical-align: middle;
  pointer-events: none;
}

.tp-ann-size-dec-btn,
.tp-ann-size-inc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 5px !important;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  border-radius: 4px;
}

.tp-ann-size-dec-btn:hover,
.tp-ann-size-inc-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

.tp-ann-quick-del svg {
  width: 12px;
  height: 12px;
  margin: 0 !important;
}

.tp-ann-quick-del:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

.tp-ann-edit-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(2, 132, 199, 0.25) !important;
  color: #38bdf8 !important;
  cursor: pointer;
  padding: 3px 5px !important;
  border-radius: 4px;
  transition: background 0.15s, transform 0.1s;
}

.tp-ann-edit-btn:hover,
.tp-ann-edit-btn:active {
  background: rgba(2, 132, 199, 0.45) !important;
  color: #e0f2fe !important;
}

.tp-ann-rotate-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(56, 189, 248, 0.16) !important;
  color: #38bdf8 !important;
  cursor: pointer;
  padding: 3px 5px !important;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.tp-ann-rotate-btn:hover {
  background: rgba(56, 189, 248, 0.3) !important;
  color: #e0f2fe !important;
}

.tp-ann-rot-handle {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-green, #10a36b);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 35;
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.tp-ann-rot-handle::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 6px;
  background: var(--brand-green, #10a36b);
}

.tp-ann-rot-handle:hover,
.tp-ann-rot-handle:active {
  background: #059669;
  transform: translateX(-50%) scale(1.18);
  cursor: grabbing;
}

.tp-ann-rot-handle svg {
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.tp-ann-item.active .tp-ann-rot-handle,
.tp-ann-item.is-selected .tp-ann-rot-handle {
  display: flex;
}

.tp-ann-dup-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #38bdf8;
  cursor: pointer;
  padding: 2px 6px;
  font-weight: 600;
  border-radius: 4px;
  font-size: 0.74rem;
  transition: background 0.15s;
}

.tp-ann-dup-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

.tp-ann-quick-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 6px;
  font-weight: bold;
  border-radius: 4px;
  font-size: 0.76rem;
  transition: background 0.15s;
}

.tp-ann-quick-del:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.tp-ann-size-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border-radius: 6px;
  border: 1px solid var(--border-mid);
  overflow: hidden;
  height: 30px;
}

.tp-ann-size-stepper button {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 8px !important;
  height: 30px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tp-ann-size-stepper button:hover {
  background: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="dark"] .tp-ann-size-stepper button:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.tp-ann-size-stepper select {
  border: none !important;
  box-shadow: none !important;
  border-left: 1px solid var(--border-light) !important;
  border-right: 1px solid var(--border-light) !important;
  border-radius: 0 !important;
  height: 30px !important;
  padding: 0 4px !important;
  background: transparent !important;
  color: var(--text-primary);
  font-size: 0.8rem !important;
}

.tp-ann-text-box {
  padding: 0;
  margin: 0;
  line-height: 1.15;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: move;
  outline: none;
  min-width: 20px;
  min-height: 1.15em;
  pointer-events: auto;
  box-sizing: border-box;
}

.tp-ann-text-box:focus {
  cursor: text;
}

.tp-ann-text-box:empty::before {
  content: 'Type text...';
  color: rgba(0, 0, 0, 0.35);
}

.tp-ann-item .tp-ann-resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid var(--brand-green, #10a36b);
  border-radius: 50%;
  cursor: se-resize;
  touch-action: none;
  z-index: 15;
  display: none;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.tp-ann-item .tp-ann-resize-handle::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

.tp-ann-item.active .tp-ann-resize-handle,
.tp-ann-item.is-selected .tp-ann-resize-handle {
  display: block;
}

.tp-ann-item .tp-ann-resize-handle.tl {
  top: -7px;
  left: -7px;
  right: auto;
  bottom: auto;
  cursor: nwse-resize;
}

.tp-ann-item .tp-ann-resize-handle.tr {
  top: -7px;
  right: -7px;
  left: auto;
  bottom: auto;
  cursor: nesw-resize;
}

.tp-ann-item .tp-ann-resize-handle.bl {
  bottom: -7px;
  left: -7px;
  right: auto;
  top: auto;
  cursor: nesw-resize;
}

.tp-ann-item .tp-ann-resize-handle.br,
.tp-ann-item .tp-ann-resize-handle[data-handle="se"] {
  bottom: -7px;
  right: -7px;
  top: auto;
  left: auto;
  cursor: nwse-resize;
}

.tp-ann-floating-actions {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(4px);
  padding: 3px 6px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 20;
  pointer-events: auto;
  white-space: nowrap;
}

.tp-ann-floating-actions button {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}

.tp-ann-floating-actions button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tp-ann-whiteout-box {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tp-ann-image-box {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Signature Pad Modal */
.tp-sig-pad-box {
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-mid);
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
  display: block;
  width: 100%;
  max-width: 100%;
}

.tp-ann-crop-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #38bdf8;
  cursor: pointer;
  padding: 2px 6px;
  font-weight: 600;
  border-radius: 3px;
  font-size: 0.72rem;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.tp-ann-crop-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

/* ==========================================================================
   Image Cropper Modal for PDF Editor
   ========================================================================== */
.tp-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 100010;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: tp-fade-in 0.2s ease;
  touch-action: manipulation;
}

.tp-crop-container {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.tp-crop-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.tp-crop-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tp-crop-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.tp-crop-close-btn:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

.tp-crop-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
  padding: 14px;
  overflow: hidden;
  position: relative;
  min-height: 260px;
  max-height: 56vh;
}

.tp-crop-stage-container {
  position: relative;
  display: inline-block;
  line-height: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  max-width: 100%;
  max-height: 100%;
}

.tp-crop-stage-container canvas {
  display: block;
  max-width: 100%;
  max-height: 50vh;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
}

.tp-crop-box-overlay {
  position: absolute;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  box-sizing: border-box;
  touch-action: none;
  cursor: move;
}

/* Grid lines inside crop box (rule of thirds) */
.tp-crop-grid-h1,
.tp-crop-grid-h2,
.tp-crop-grid-v1,
.tp-crop-grid-v2 {
  position: absolute;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.28);
}

.tp-crop-grid-h1 {
  left: 0;
  right: 0;
  top: 33.33%;
  height: 1px;
}

.tp-crop-grid-h2 {
  left: 0;
  right: 0;
  top: 66.66%;
  height: 1px;
}

.tp-crop-grid-v1 {
  top: 0;
  bottom: 0;
  left: 33.33%;
  width: 1px;
}

.tp-crop-grid-v2 {
  top: 0;
  bottom: 0;
  left: 66.66%;
  width: 1px;
}

/* Handles */
.tp-crop-handle {
  position: absolute;
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  touch-action: none;
  z-index: 5;
}

.tp-crop-handle::after {
  content: '';
  position: absolute;
  inset: -14px;
}

.tp-crop-handle-nw {
  top: -6px;
  left: -6px;
  width: 13px;
  height: 13px;
  cursor: nwse-resize;
}

.tp-crop-handle-ne {
  top: -6px;
  right: -6px;
  width: 13px;
  height: 13px;
  cursor: nesw-resize;
}

.tp-crop-handle-se {
  bottom: -6px;
  right: -6px;
  width: 13px;
  height: 13px;
  cursor: nwse-resize;
}

.tp-crop-handle-sw {
  bottom: -6px;
  left: -6px;
  width: 13px;
  height: 13px;
  cursor: nesw-resize;
}

.tp-crop-handle-n {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 9px;
  cursor: ns-resize;
  border-radius: 2px;
}

.tp-crop-handle-s {
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 9px;
  cursor: ns-resize;
  border-radius: 2px;
}

.tp-crop-handle-w {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 22px;
  cursor: ew-resize;
  border-radius: 2px;
}

.tp-crop-handle-e {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 22px;
  cursor: ew-resize;
  border-radius: 2px;
}

.tp-crop-toolbar {
  padding: 10px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.tp-crop-ratios-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.tp-crop-ratios-scroll::-webkit-scrollbar {
  height: 2px;
}

.tp-crop-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Format Toggle Buttons for Bold & Italic */
.tp-format-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-mid);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.tp-format-toggle-btn input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.tp-format-toggle-btn:has(input:checked),
.tp-format-toggle-btn.is-active {
  background: var(--brand-green);
  color: #ffffff;
  border-color: var(--brand-green);
  box-shadow: 0 2px 6px rgba(16, 163, 107, 0.3);
}

/* ==========================================================================
   Text Editor Modal / Bottom-Sheet for PDF Editor
   ========================================================================== */
@keyframes tp-modal-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes tp-modal-scale {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tp-modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(100%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-text-modal {
  position: fixed;
  inset: 0;
  z-index: 100010;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: tp-modal-fade 0.2s ease;
  touch-action: manipulation;
}

.tp-text-modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl, 16px);
  width: 100%;
  max-width: 490px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: tp-modal-scale 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-text-modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}

.tp-text-modal-header h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-text-modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.tp-text-modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

.tp-text-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 72vh;
}

.tp-text-modal-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
}

.tp-text-modal-sublabel {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.tp-text-field-wrap textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.96rem;
  line-height: 1.4;
  border: 1.5px solid var(--border-mid);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tp-text-field-wrap textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(16, 163, 107, 0.2);
}

.tp-text-modal-format-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.tp-text-modal-group {
  display: flex;
  flex-direction: column;
}

.tp-text-modal-group select {
  height: 34px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-mid);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.84rem;
  outline: none;
}

.tp-text-modal-color-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-text-color-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s, border-color 0.15s;
  padding: 0;
  outline: none;
}

.tp-color-swatch:hover {
  transform: scale(1.15);
}

.tp-color-swatch.active {
  border-color: var(--brand-green);
  transform: scale(1.18);
  box-shadow: 0 0 0 2px rgba(16, 163, 107, 0.45);
}

.tp-color-custom-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}

.tp-color-custom-wrap input[type="color"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  left: 0;
  top: 0;
}

.tp-color-custom-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-mid);
  background: var(--bg-surface);
  color: var(--text-primary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tp-color-custom-btn:hover {
  border-color: var(--brand-green);
  background: var(--bg-card);
}

.tp-color-custom-btn.active {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 2px rgba(16, 163, 107, 0.35);
  font-weight: 700;
}

.tp-custom-preview-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  display: inline-block;
  flex-shrink: 0;
}

/* Modal Text Rotation Controls */
.tp-text-modal-rot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.tp-rot-chips {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.tp-rot-chip {
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-mid);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tp-rot-chip:hover {
  border-color: var(--brand-green);
  color: var(--text-primary);
  background: var(--bg-card);
}

.tp-rot-chip.active {
  background: var(--brand-green);
  color: #ffffff;
  border-color: var(--brand-green);
  box-shadow: 0 1px 4px rgba(16, 163, 107, 0.35);
}

.tp-rot-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 140px;
}

.tp-rot-slider-wrap input[type="range"] {
  flex: 1;
  cursor: pointer;
  accent-color: var(--brand-green);
  height: 6px;
}

.tp-rot-angle-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-green);
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tp-text-modal-preview-box {
  background: rgba(0, 0, 0, 0.03);
  border: 1px dashed var(--border-mid);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

[data-theme="dark"] .tp-text-modal-preview-box {
  background: rgba(255, 255, 255, 0.04);
}

.tp-text-preview-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
}

#tp-text-modal-preview-text {
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.25;
}

.tp-text-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-surface);
}

@media (max-width: 768px) {
  .tp-pdf-editor-modal {
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  .tp-pdf-editor-container {
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
  }

  /* 1. Header: Slim, clean native app bar at top */
  .tp-pdf-editor-header {
    order: 1;
    height: 48px;
    min-height: 48px;
    padding: 6px 12px;
    gap: 8px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
  }

  .tp-pdf-editor-header-title {
    gap: 6px;
  }

  .tp-pdf-header-heading {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    max-width: 110px;
  }

  .tp-pdf-header-sub {
    display: none;
  }

  .tp-pdf-editor-header-actions {
    gap: 5px;
  }

  .tp-pdf-editor-header-actions .tp-btn {
    height: 32px;
    padding: 4px 8px;
    font-size: 0.76rem;
    border-radius: 6px;
  }

  .tp-pdf-editor-header-actions .tp-btn span {
    display: none;
  }

  .tp-pdf-editor-header-actions #tp-ann-save-btn::after {
    content: ' Apply';
    font-weight: 700;
  }

  .tp-pdf-zoom-controls {
    height: 30px;
    border-radius: 8px;
  }

  .tp-zoom-badge {
    display: inline-block;
    font-size: 0.72rem;
    min-width: 36px;
    padding: 0 4px;
    line-height: 28px;
  }

  /* 2. Workspace: Takes up 80%+ of phone screen with room for floating nav */
  .tp-pdf-workspace-area {
    order: 2;
    flex: 1;
    padding: 10px 8px 115px 8px;
    /* Room for floating bottom nav */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #cbd5e1;
  }

  [data-theme="dark"] .tp-pdf-workspace-area {
    background: #0f172a;
  }

  /* 3. Toolbar: Floating Bottom Nav Bar */
  .tp-pdf-editor-toolbar {
    position: absolute;
    bottom: 12px;
    left: 10px;
    right: 10px;
    margin: 0 auto;
    max-width: calc(100vw - 20px);
    width: auto;
    padding: 6px;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
  }

  [data-theme="dark"] .tp-pdf-editor-toolbar {
    background: rgba(15, 23, 42, 0.93);
    border-color: rgba(51, 65, 85, 0.9);
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  /* Primary Tools: Floating bottom navigation strip */
  .tp-pdf-toolbar-row-main {
    height: 44px;
    min-height: 44px;
    padding: 2px 4px;
    gap: 6px;
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border: none;
  }

  .tp-pdf-toolbar-row-main::-webkit-scrollbar {
    display: none;
  }

  .tp-pdf-toolbar-row-main .tp-btn {
    height: 36px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Contextual Text Formatting: Floating upper capsule above primary tools */
  .tp-pdf-toolbar-row-options {
    display: none;
    /* Hidden on mobile by default! */
    height: 42px;
    min-height: 42px;
    padding: 4px 8px;
    gap: 6px;
    background: rgba(241, 245, 249, 0.92);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
    box-sizing: border-box;
  }

  [data-theme="dark"] .tp-pdf-toolbar-row-options {
    background: rgba(30, 41, 59, 0.92);
  }

  /* Appears smoothly when Text Mode is active or text is selected */
  .tp-pdf-toolbar-row-options.tp-panel-active {
    display: flex !important;
  }

  .tp-pdf-toolbar-row-options select#tp-ann-font-family {
    min-width: 100px;
    max-width: 120px;
    height: 32px;
    flex-shrink: 0;
    font-size: 0.78rem;
    border-radius: 6px;
  }

  .tp-pdf-toolbar-row-options .tp-ann-size-stepper {
    flex-shrink: 0;
    height: 32px;
  }

  .tp-pdf-toolbar-row-options .tp-ann-size-stepper select#tp-ann-font-size {
    width: 54px;
    min-width: 50px;
    height: 32px;
    flex-shrink: 0;
    font-size: 0.76rem;
  }

  .tp-pdf-toolbar-row-options .tp-ann-size-stepper button {
    height: 32px !important;
    padding: 0 6px !important;
  }

  .tp-pdf-toolbar-row-options input[type="color"] {
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
    flex-shrink: 0;
  }

  .tp-pdf-toolbar-row-options input[type="text"] {
    flex: 0 0 140px !important;
    min-width: 130px !important;
    height: 32px !important;
    font-size: 0.78rem !important;
    padding: 4px 8px !important;
    border-radius: 6px;
  }

  .tp-pdf-toolbar-row-options .tp-btn {
    height: 32px;
    padding: 4px 8px;
    font-size: 0.76rem;
    flex-shrink: 0;
    border-radius: 6px;
  }

  .tp-crop-container {
    max-height: 96vh;
    max-height: 96dvh;
    border-radius: 12px;
  }

  .tp-crop-body {
    padding: 8px;
    min-height: 220px;
  }

  /* Text Editor Modal Mobile - Centered in middle */
  .tp-text-modal {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }

  .tp-text-modal-container {
    max-width: 95%;
    border-radius: 16px;
    border-bottom: 1px solid var(--border-mid);
    max-height: 90vh;
    max-height: 90dvh;
    animation: tp-modal-scale 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .tp-text-modal-body {
    padding: 14px 16px;
    gap: 12px;
  }

  .tp-text-modal-format-row {
    gap: 8px;
  }

  /* Mobile drag bar & buttons touch targets */
  .tp-ann-drag-bar {
    padding: 3px 5px;
    gap: 5px;
    border-radius: 8px;
    font-size: 0.78rem;
  }

  .tp-ann-drag-bar button,
  .tp-ann-drag-bar span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tp-ann-drag-bar .tp-ann-edit-btn {
    min-width: 44px;
    padding: 3px 9px !important;
    font-size: 0.78rem !important;
  }
}

@media (max-width: 480px) {
  .tp-pdf-header-heading {
    font-size: 0.82rem;
    max-width: 90px;
  }

  .tp-zoom-badge {
    display: none;
  }

  .tp-crop-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .tp-crop-actions-row>div {
    display: flex;
    justify-content: space-between;
  }
}

/* ==========================================================================
   Audio Spectrum Waveform & Cutter Interactive Handles
   ========================================================================== */
.tp-wave-container {
  position: relative;
  width: 100%;
  height: 130px;
  background: #080c16;
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: crosshair;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}

.tp-track-wave-container {
  position: relative;
  width: 100%;
  height: 72px;
  background: #080c16;
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: crosshair;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.5);
  margin-top: 6px;
}

.tp-wave-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.tp-wave-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(3, 6, 12, 0.76);
  pointer-events: none;
  backdrop-filter: blur(1.5px);
}

.tp-wave-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(16, 185, 129, 0.1);
  border-top: 2px solid #10b981;
  border-bottom: 2px solid #10b981;
  pointer-events: none;
  box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.15);
}

.tp-wave-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.5px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 1);
  pointer-events: none;
  z-index: 8;
  transform: translateX(-50%);
  display: none;
}

.tp-wave-playhead-head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 1);
}

.tp-wave-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42px;
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 10;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}

.tp-wave-handle-line {
  width: 4px;
  flex: 1;
  border-radius: 2px;
}

.tp-wave-handle-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  color: #ffffff;
  letter-spacing: 0.5px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.tp-wave-handle-grip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  margin-bottom: 2px;
}

/* START Bar (Emerald Green) */
.tp-wave-handle-start .tp-wave-handle-line {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 1);
}

.tp-wave-handle-start .tp-wave-handle-badge {
  background: #10b981;
}

.tp-wave-handle-start .tp-wave-handle-grip {
  background: #10b981;
}

/* END Bar (Coral Red) */
.tp-wave-handle-end .tp-wave-handle-line {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 1);
}

.tp-wave-handle-end .tp-wave-handle-badge {
  background: #ef4444;
}

.tp-wave-handle-end .tp-wave-handle-grip {
  background: #ef4444;
}

/* ==========================================================================
   AUDIO CUTTER STUDIO REDESIGN — Start/End Point & Fade Transition Cards
   ========================================================================== */
.tp-aud-trim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.tp-aud-time-card {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-xs, 0 1px 3px rgba(0, 0, 0, 0.04));
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-aud-start-card {
  border-left: 4px solid #10b981 !important;
}

.tp-aud-end-card {
  border-left: 4px solid #ef4444 !important;
}

.tp-aud-time-card:hover {
  box-shadow: var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.06));
}

.tp-aud-time-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tp-aud-time-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.tp-aud-time-label .start-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.tp-aud-time-label .end-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.tp-aud-pos-btn {
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
  border-radius: var(--r-pill, 9999px) !important;
  gap: 4px !important;
  transition: all 0.2s ease !important;
}

.tp-aud-pos-btn:hover {
  background: var(--brand-green-lite, #e9f4f1) !important;
  color: var(--brand-green, #1a6a58) !important;
  border-color: var(--brand-green, #1a6a58) !important;
}

.tp-aud-time-input-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface-alt, #f8fafc);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light, #e2e8f0);
}

.tp-aud-time-formatted {
  font-family: var(--font-mono, monospace);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.tp-aud-input-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-mid, #cbd5e1);
  padding: 2px 8px;
  border-radius: 8px;
}

.tp-aud-num-input {
  border: none !important;
  background: transparent !important;
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  width: 68px !important;
  text-align: right !important;
  padding: 4px 0 !important;
  outline: none !important;
}

.tp-aud-affix {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tp-aud-steppers {
  display: flex;
  gap: 6px;
  width: 100%;
}

.tp-stepper-btn {
  flex: 1;
  padding: 5px 2px;
  background: var(--bg-input, #f1f5f9);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.tp-stepper-btn:hover {
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary);
  border-color: var(--border-mid, #cbd5e1);
  transform: translateY(-1px);
}

.tp-stepper-btn:active {
  transform: translateY(0);
}

/* Duration Summary Bar */
.tp-aud-duration-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 14px;
  padding: 12px 18px;
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  gap: 16px;
  flex-wrap: wrap;
}

.tp-aud-dur-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-aud-dur-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tp-aud-dur-val {
  font-family: var(--font-mono, monospace);
  font-size: 1.1rem;
  font-weight: 800;
  color: #10b981;
}

.tp-aud-dur-val.secondary {
  color: var(--text-primary);
}

.tp-aud-dur-divider {
  width: 1px;
  height: 20px;
  background: var(--border-light, #e2e8f0);
}

/* Studio Fade Transitions Grid */
.tp-aud-fade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.tp-aud-fade-card {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-xs, 0 1px 3px rgba(0, 0, 0, 0.04));
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-aud-fade-card.active {
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08) !important;
}

.tp-aud-fade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tp-aud-fade-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-aud-fade-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-aud-fade-icon.in {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.tp-aud-fade-icon.out {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.tp-aud-fade-title {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.tp-aud-fade-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.tp-aud-fade-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light, #f1f5f9);
}

.tp-aud-fade-dur-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tp-aud-fade-chips {
  display: flex;
  gap: 6px;
  flex: 1;
}

.tp-aud-chip {
  flex: 1;
  padding: 5px 6px;
  background: var(--bg-input, #f1f5f9);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--r-pill, 9999px);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.tp-aud-chip:hover {
  background: var(--brand-green-lite, #e9f4f1);
  color: var(--brand-green, #1a6a58);
}

.tp-aud-chip.active {
  background: var(--brand-green) !important;
  color: #ffffff !important;
  border-color: var(--brand-green) !important;
  box-shadow: var(--shadow-green);
}

/* iOS Style Switch */
.tp-aud-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.tp-aud-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.tp-aud-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-mid, #cbd5e1);
  transition: 0.25s ease;
  border-radius: 24px;
}

.tp-aud-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.tp-aud-switch input:checked+.tp-aud-slider {
  background-color: var(--brand-green);
}

.tp-aud-switch input:checked+.tp-aud-slider:before {
  transform: translateX(20px);
}

/* Dark mode overrides */
[data-theme="dark"] .tp-aud-time-card,
[data-theme="dark"] .tp-aud-fade-card {
  background: #131b2e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .tp-aud-time-input-wrap,
[data-theme="dark"] .tp-aud-duration-bar {
  background: #0b0f19 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .tp-aud-input-badge {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .tp-stepper-btn,
[data-theme="dark"] .tp-aud-chip {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .tp-stepper-btn:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

@media (max-width: 680px) {

  .tp-aud-trim-grid,
  .tp-aud-fade-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* ==========================================================================
   Music Merger & Audio Multitrack Styles
   ========================================================================== */
.tp-merge-track-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs, 0 1px 3px rgba(0, 0, 0, 0.05));
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tp-merge-track-card:hover {
  border-color: var(--brand-green-mid, #1d7a65);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
}

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

.tp-merge-track-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 240px;
}

.tp-track-num {
  font-weight: 800;
  color: var(--brand-green, #1a6a58);
  font-size: 0.82rem;
  background: var(--brand-green-lite, #e9f4f1);
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.tp-btn-track-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--brand-green, #1a6a58);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}

.tp-btn-track-play:hover {
  transform: scale(1.08);
  background: var(--brand-green-mid, #1d7a65);
}

.tp-track-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tp-track-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #111);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-track-meta {
  font-size: 0.74rem;
  color: var(--text-muted, #777);
  margin-top: 1px;
}

.tp-merge-track-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tp-btn-icon-xs {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.15));
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #111);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
}

.tp-btn-icon-xs:hover:not(:disabled) {
  background: var(--bg-input, #f0f0f0);
}

.tp-btn-icon-xs.tp-btn-danger:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

.tp-merge-track-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-light, rgba(0, 0, 0, 0.08));
}

.tp-track-control-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tp-track-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary, #555);
}

.tp-btn-link-mute {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--brand-green, #1a6a58);
  font-weight: 600;
  padding: 0;
}

.tp-btn-link-mute.muted {
  color: #ef4444;
}

.tp-input-xs {
  padding: 4px 6px !important;
  font-size: 0.78rem !important;
  width: 78px !important;
  height: 28px !important;
  text-align: center;
}

.tp-range-sm {
  height: 24px !important;
}

.tp-range-sm::-webkit-slider-runnable-track {
  height: 4px !important;
}

.tp-range-sm::-moz-range-track {
  height: 4px !important;
}

.tp-range-sm::-webkit-slider-thumb {
  width: 14px !important;
  height: 14px !important;
  margin-top: -5px !important;
}

.tp-range-sm::-moz-range-thumb {
  width: 14px !important;
  height: 14px !important;
}

/* ==========================================
   PASSPORT PHOTO RESIZER - MOBILE RESPONSIVE
   ========================================== */
/* Passport Photo Resizer - Preset Dropdown */
.tp-passport-preset-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg, 12px);
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.tp-passport-preset-card:focus-within {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(26, 106, 88, 0.12);
}

.tp-passport-preset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tp-passport-preset-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.tp-passport-preset-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(26, 106, 88, 0.12);
  color: var(--brand-green);
  flex-shrink: 0;
}

.tp-passport-preset-icon svg {
  width: 15px;
  height: 15px;
}

.tp-passport-preset-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-green);
  background: rgba(26, 106, 88, 0.08);
  border: 1px solid rgba(26, 106, 88, 0.22);
  border-radius: 999px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.tp-passport-preset-select {
  width: 100%;
  height: 48px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-medium, #d1d5db);
  border-radius: var(--r-md, 8px);
  padding: 10px 42px 10px 14px;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.tp-passport-preset-select:hover {
  border-color: var(--brand-green);
}

.tp-passport-preset-select:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(26, 106, 88, 0.15);
}

.tp-passport-preset-select optgroup {
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface);
  font-size: 0.85rem;
  padding-top: 6px;
}

.tp-passport-preset-select option {
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
  padding: 6px 10px;
  font-size: 0.92rem;
}

/* Dark mode overrides */
[data-theme="dark"] .tp-passport-preset-card {
  background: var(--bg-surface);
  border-color: var(--border-medium);
}

[data-theme="dark"] .tp-passport-preset-icon {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

[data-theme="dark"] .tp-passport-preset-badge {
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.25);
}

[data-theme="dark"] .tp-passport-preset-select {
  background-color: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .tp-passport-preset-card {
    padding: 12px 14px;
    margin-bottom: 16px;
  }

  .tp-passport-preset-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .tp-passport-preset-badge {
    align-self: flex-start;
    font-size: 0.74rem;
    padding: 2px 10px;
  }

  .tp-passport-preset-select {
    height: 46px;
    font-size: 16px !important;
    /* Prevents auto-zoom on iOS */
    padding: 10px 36px 10px 12px;
  }
}

.tp-passport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.tp-passport-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
}

.tp-passport-dropdown {
  margin: 0 0 14px 0 !important;
  border: 1.5px solid var(--border-light) !important;
  border-radius: 12px !important;
  background: var(--bg-card) !important;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tp-passport-dropdown[open] {
  border-color: rgba(26, 106, 88, 0.4) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.tp-passport-dropdown .tp-dropdown-summary {
  padding: 12px 16px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  border-radius: 12px;
  background: var(--bg-card);
}

.tp-passport-dropdown[open] .tp-dropdown-summary {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.tp-passport-dropdown .tp-dropdown-body {
  padding: 16px !important;
  border-top: 1px solid var(--border-light) !important;
  background: var(--bg-warm) !important;
}

[data-theme="dark"] .tp-passport-dropdown .tp-dropdown-body {
  background: rgba(255, 255, 255, 0.02) !important;
}

.tp-passport-unit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tp-passport-btn-group {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.tp-passport-btn-group .tp-btn {
  flex: 1;
  min-width: 0;
  padding: 6px 2px !important;
  font-size: 0.8rem !important;
  text-align: center;
  justify-content: center;
}

.tp-passport-fit-group {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.tp-passport-fit-group .tp-btn {
  flex: 1;
  min-width: 0;
  padding: 6px 8px !important;
  font-size: 0.8rem !important;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}

.tp-passport-quick-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.tp-passport-quick-tools .tp-btn {
  padding: 6px 4px !important;
  font-size: 0.78rem !important;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}

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

  .tp-passport-card {
    padding: 14px;
  }

  .tp-passport-quick-tools {
    grid-template-columns: repeat(2, 1fr);
  }

  .tp-passport-fit-group {
    flex-direction: column;
  }

  .tp-passport-fit-group .tp-btn {
    width: 100%;
  }

  #pass-name-date-inputs {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

.tp-passport-preview-box {
  padding: 20px 12px;
  background: radial-gradient(circle, var(--bg-card) 0%, var(--bg-input) 100%);
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tp-passport-canvas-wrapper {
  display: inline-block;
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  cursor: grab;
  touch-action: none;
  user-select: none;
  max-width: 100%;
}

.tp-passport-canvas-wrapper:active {
  cursor: grabbing;
}

.tp-passport-canvas-wrapper canvas {
  display: block;
  max-height: 320px;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
}

@media (max-width: 560px) {
  .tp-passport-canvas-wrapper canvas {
    max-height: 250px;
  }
}

.tp-passport-drag-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tp-passport-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .tp-passport-actions {
    flex-direction: column !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  .tp-passport-actions .tp-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 46px !important;
    font-size: 0.92rem !important;
  }
}

/* ==========================================
   IMAGE EDITOR - ALL-IN-ONE (MOBILE RESPONSIVE)
   ========================================== */
.tp-editor-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.tp-editor-header-bar .tp-editor-tabs {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
  flex: 1;
  min-width: 260px;
}

.tp-editor-history-btns {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.tp-history-btn:disabled,
.tp-history-btn[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: auto;
}

.tp-editor-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tp-editor-tabs::-webkit-scrollbar {
  height: 4px;
}

.tp-editor-tabs::-webkit-scrollbar-thumb {
  background: var(--border-medium, rgba(0, 0, 0, 0.15));
  border-radius: 4px;
}

.tp-editor-tab-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.tp-editor-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--r-pill, 9999px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-editor-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.tp-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.tp-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
}

.tp-editor-stage-wrap {
  background: radial-gradient(circle, var(--bg-card) 0%, var(--bg-input) 100%);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  overflow: clip;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.tp-editor-canvas-container {
  display: inline-block;
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  border-radius: 6px;
  overflow: visible !important;
  background: #fff;
  max-width: 100%;
  line-height: 0;
  vertical-align: middle;
  padding: 0;
  border: none;
  margin: 0;
}

.tp-editor-canvas-container canvas {
  display: block;
  max-height: 400px;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 6px;
}

/* Base: Controls & Bottom Bar Hidden Until Image Upload */
#img-editor-controls {
  display: none;
}

#img-editor-controls.active {
  display: block;
}

.tp-editor-bottom-bar {
  display: none !important;
}

@media (max-width: 768px) {

  /* Hide top desktop tabs on mobile */
  .tp-editor-tabs {
    display: none !important;
  }

  /* Reorder: Canvas Stage first, then Controls (Only when image is uploaded) */
  #img-editor-controls {
    display: none !important;
  }

  #img-editor-controls.active {
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 86px !important;
    /* Space for floating dock */
  }

  .tp-editor-stage-wrap {
    order: 1 !important;
    padding: 8px 6px !important;
    margin-bottom: 10px !important;
    border-radius: 8px !important;
  }

  .tp-editor-canvas-container canvas {
    max-height: 300px !important;
  }

  #editor-meta-info {
    margin-top: 4px !important;
    font-size: 0.78rem !important;
  }

  /* Active Panels docked directly below canvas */
  #editor-panel-crop,
  #editor-panel-adjust,
  #editor-panel-filter,
  #editor-panel-text,
  #editor-panel-overlay {
    order: 2 !important;
  }

  .tp-editor-card {
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
    border-radius: 8px !important;
  }

  /* Tighten spacing in mobile view */
  .tp-editor-card .tp-form-group {
    margin-bottom: 6px !important;
  }

  .tp-editor-card label {
    font-size: 0.78rem !important;
    margin-bottom: 3px !important;
  }

  .tp-editor-card hr {
    margin: 8px 0 !important;
  }

  .tp-canva-hint {
    padding: 6px 10px !important;
    margin-bottom: 8px !important;
    font-size: 0.76rem !important;
    line-height: 1.35 !important;
  }

  .tp-crop-ratios {
    margin-bottom: 8px !important;
    gap: 4px !important;
    padding-bottom: 4px !important;
  }

  .tp-crop-ratios .tp-chip {
    padding: 4px 10px !important;
    font-size: 0.76rem !important;
  }

  .tp-text-preset-grid {
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .tp-text-preset-grid .tp-btn {
    padding: 6px 8px !important;
    font-size: 0.76rem !important;
  }

  /* Compact 2-column layout for text, overlay & adjust sliders */
  .tp-dropdown-body div[style*="grid-template-columns"],
  #editor-panel-text>div[style*="grid-template-columns"],
  #editor-panel-overlay>div[style*="grid-template-columns"],
  #editor-panel-adjust>div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }

  /* Bottom Floating Dock (Only when image is uploaded) */
  .tp-editor-bottom-bar {
    display: none !important;
  }

  #img-editor-controls.active .tp-editor-bottom-bar {
    display: flex !important;
    position: fixed !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    right: 10px !important;
    max-width: 440px !important;
    margin: 0 auto !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 30px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    padding: 5px 6px !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 9999 !important;
    gap: 2px !important;
  }

  [data-theme="dark"] .tp-editor-bottom-bar {
    background: rgba(24, 26, 32, 0.94) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  }

  .tp-editor-bottom-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    padding: 5px 2px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 16px !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
    text-decoration: none !important;
    min-width: 0 !important;
    -webkit-tap-highlight-color: transparent;
  }

  .tp-editor-bottom-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.04) !important;
  }

  [data-theme="dark"] .tp-editor-bottom-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
  }

  .tp-editor-bottom-btn.active {
    color: var(--primary) !important;
    background: rgba(37, 99, 235, 0.1) !important;
    font-weight: 700 !important;
  }

  [data-theme="dark"] .tp-editor-bottom-btn.active {
    background: rgba(59, 130, 246, 0.18) !important;
    color: #60a5fa !important;
  }

  .tp-editor-bottom-btn .tp-btm-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    margin-bottom: 2px !important;
  }

  .tp-editor-bottom-btn .tp-btm-icon svg {
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
  }

  .tp-editor-bottom-btn .tp-btm-label {
    font-size: 0.66rem !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    line-height: 1 !important;
  }

}

.tp-crop-ratios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .tp-crop-ratios {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    gap: 6px;
    scrollbar-width: thin;
  }

  .tp-crop-ratios .tp-chip {
    flex-shrink: 0;
  }
}

/* Filter Presets Grid Layout */
.tp-editor-filter-grid,
.tp-editor-filter-chips {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: visible !important;
  padding-bottom: 0 !important;
}

.tp-editor-filter-grid .tp-chip,
.tp-editor-filter-chips .tp-chip {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  min-height: 40px !important;
  padding: 8px 10px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  border-radius: var(--r-md, 8px) !important;
  background: var(--bg-input) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  flex-shrink: initial !important;
  white-space: normal !important;
  line-height: 1.25 !important;
}

.tp-editor-filter-grid .tp-chip:hover,
.tp-editor-filter-chips .tp-chip:hover {
  background: var(--brand-green-lite) !important;
  color: var(--brand-green) !important;
  border-color: rgba(26, 106, 88, 0.35) !important;
  transform: translateY(-1px);
}

.tp-editor-filter-grid .tp-chip.active,
.tp-editor-filter-chips .tp-chip.active {
  background: var(--brand-green) !important;
  color: #ffffff !important;
  border-color: var(--brand-green) !important;
  box-shadow: 0 2px 8px rgba(26, 106, 88, 0.35) !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .tp-editor-filter-grid .tp-chip,
[data-theme="dark"] .tp-editor-filter-chips .tp-chip {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .tp-editor-filter-grid .tp-chip:hover,
[data-theme="dark"] .tp-editor-filter-chips .tp-chip:hover {
  background: rgba(26, 106, 88, 0.25) !important;
  color: #5eead4 !important;
  border-color: rgba(94, 234, 212, 0.4) !important;
}

[data-theme="dark"] .tp-editor-filter-grid .tp-chip.active,
[data-theme="dark"] .tp-editor-filter-chips .tp-chip.active {
  background: var(--brand-green) !important;
  color: #ffffff !important;
  border-color: #5eead4 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

@media (max-width: 640px) {

  .tp-editor-filter-grid,
  .tp-editor-filter-chips {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
    margin-bottom: 10px !important;
  }

  .tp-editor-filter-grid .tp-chip,
  .tp-editor-filter-chips .tp-chip {
    padding: 8px 6px !important;
    font-size: 0.78rem !important;
    min-height: 38px !important;
  }

  .tp-editor-filter-grid .tp-chip:last-child:nth-child(odd),
  .tp-editor-filter-chips .tp-chip:last-child:nth-child(odd) {
    grid-column: span 2 !important;
  }
}

.tp-editor-quick-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.tp-editor-quick-tools .tp-btn {
  padding: 6px 4px !important;
  font-size: 0.78rem !important;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .tp-editor-quick-tools {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tp-editor-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .tp-editor-actions {
    flex-direction: column !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  .tp-editor-actions .tp-btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 46px !important;
    font-size: 0.92rem !important;
  }
}

/* Canva-style Interactive Direct Canvas Editing */
.tp-canva-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--r-md);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.4;
}

[data-theme="dark"] .tp-canva-hint {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.tp-editor-canvas-container {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.tp-editor-canvas-container canvas {
  touch-action: none;
  cursor: default;
}

/* Canvas Direct-Action Alternative Dropdowns (Collapsible Sliders) */
.tp-canvas-alt-dropdown {
  margin: 10px 0 14px;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-card, #ffffff);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .tp-canvas-alt-dropdown {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.tp-canvas-alt-dropdown[open] {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.tp-dropdown-summary {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 14px !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: var(--text-heading, #1e293b) !important;
  list-style: none !important;
  transition: background 0.15s ease !important;
}

.tp-dropdown-summary::-webkit-details-marker {
  display: none !important;
}

.tp-dropdown-summary:hover {
  background: rgba(37, 99, 235, 0.05);
}

[data-theme="dark"] .tp-dropdown-summary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tp-dropdown-summary .tp-summary-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tp-dropdown-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-subtle, rgba(0, 0, 0, 0.06));
  color: var(--primary, #2563eb);
  font-size: 0.72rem;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .tp-dropdown-symbol {
  background: rgba(255, 255, 255, 0.09);
  color: #60a5fa;
}

.tp-canvas-alt-dropdown[open] .tp-dropdown-symbol {
  transform: rotate(180deg);
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary, #2563eb);
}

.tp-dropdown-body {
  padding: 12px 14px;
  border-top: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-subtle, rgba(0, 0, 0, 0.015));
  animation: tpDropdownFade 0.2s ease-out;
}

[data-theme="dark"] .tp-dropdown-body {
  border-top-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.14);
}

@keyframes tpDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-manual-details {
  margin-top: 14px;
  border-top: 1px dashed var(--border-light);
  padding-top: 10px;
}

.tp-manual-details summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  outline: none;
}

.tp-manual-details summary:hover {
  color: var(--primary);
}

/* Canva-Style Interactive Live Text Overlay */
.tp-editor-text-overlay {
  position: absolute;
  user-select: none;
  -webkit-user-select: none;
  cursor: move;
  text-align: center;
  box-sizing: border-box;
  padding: 8px 14px;
  line-height: 1.25;
  touch-action: none;
  z-index: 15;
  width: max-content !important;
  max-width: none !important;
  height: max-content !important;
  pointer-events: auto;
}

.tp-editor-text-overlay.is-active {
  border: 2px dashed #2563eb;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.95), 0 6px 18px rgba(0, 0, 0, 0.28);
  border-radius: 4px;
}

.tp-editor-text-overlay.is-applied {
  border: 1.5px solid transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.tp-editor-text-overlay.is-applied:hover {
  border: 1.5px dashed rgba(37, 99, 235, 0.4) !important;
}

.tp-editor-text-overlay.is-applied .tp-text-handle,
.tp-editor-text-overlay.is-applied .tp-text-toolbar {
  display: none !important;
}

.tp-editor-text-overlay .tp-text-content,
.tp-editor-extra-text-overlay {
  outline: none;
  cursor: text;
  white-space: pre !important;
  word-break: normal !important;
  width: max-content !important;
  max-width: none !important;
  min-width: 40px;
  min-height: 24px;
  line-height: 1.25;
}

.tp-editor-text-overlay .tp-text-handle,
.tp-editor-text-overlay .tp-text-toolbar {
  display: none;
}

.tp-editor-text-overlay.is-active .tp-text-handle {
  display: block;
}

.tp-editor-text-overlay.is-active .tp-text-toolbar {
  display: flex;
}

.tp-editor-text-overlay .tp-text-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  z-index: 18;
}

.tp-editor-text-overlay .tp-text-handle.tl {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}

.tp-editor-text-overlay .tp-text-handle.tr {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}

.tp-editor-text-overlay .tp-text-handle.bl {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}

.tp-editor-text-overlay .tp-text-handle.br {
  bottom: -7px;
  right: -7px;
  cursor: nwse-resize;
}

/* Direct Canvas Rotation Handle & Stem */
.tp-text-rotate-connector {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 24px;
  background: #2563eb;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 17;
  display: none;
}

.tp-editor-text-overlay.is-active .tp-text-rotate-connector {
  display: block;
}

.tp-text-rotate-handle {
  position: absolute;
  top: calc(100% + 24px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 22;
  color: #2563eb;
  touch-action: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tp-text-rotate-handle::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

.tp-editor-text-overlay.is-active .tp-text-rotate-handle {
  display: flex;
}

.tp-text-rotate-handle:hover,
.tp-text-rotate-handle:active {
  background: #2563eb;
  color: #ffffff;
  transform: translate(-50%, -50%) scale(1.18);
  cursor: grabbing;
}

body.tp-is-rotating-text,
body.tp-is-rotating-text * {
  cursor: grabbing !important;
  user-select: none !important;
}

.tp-text-rotate-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  display: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 25;
}

.tp-editor-text-overlay.is-applied .tp-text-rotate-connector,
.tp-editor-text-overlay.is-applied .tp-text-rotate-handle {
  display: none !important;
}

.tp-editor-text-overlay .tp-text-toolbar,
.tp-editor-overlay-toolbar {
  position: absolute;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 3px 8px;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  z-index: 25;
  user-select: none;
  touch-action: none;
}

.tp-editor-text-overlay .tp-text-toolbar {
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

.tp-text-drag-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 6px;
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.15s ease;
}

.tp-text-drag-bar:hover {
  background: rgba(255, 255, 255, 0.25);
}

.tp-text-drag-bar:active {
  cursor: grabbing;
}

.tp-text-toolbar-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}

.tp-text-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.tp-text-toolbar-btn.tp-text-btn-del:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5 !important;
}

.tp-text-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

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

/* Text Editor Action Buttons Grid */
.tp-text-action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.tp-text-action-buttons-grid .tp-btn {
  width: 100% !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 8px 8px !important;
  font-size: 0.82rem !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  min-height: 38px;
}

.tp-btn-clear-delete {
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.35) !important;
}

.tp-btn-clear-delete:hover {
  background: rgba(220, 38, 38, 0.08) !important;
  border-color: #dc2626 !important;
  color: #b91c1c !important;
}

/* Text Editor Circular Color Selectors */
.tp-text-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.tp-color-select-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input, #F5F4F0);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: var(--r-md, 8px);
  padding: 6px 12px;
  min-height: 42px;
  box-sizing: border-box;
  gap: 8px;
}

.tp-color-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #111111);
  margin: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}

.tp-color-circle-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 2px 5px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
  margin: 0;
  background: none;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  vertical-align: middle;
}

.tp-color-circle-picker:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 1.5px var(--primary, #1a6a58), 0 2px 6px rgba(0, 0, 0, 0.22);
}

.tp-color-circle-picker::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

.tp-color-circle-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.tp-color-circle-picker::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

[data-theme="dark"] .tp-color-select-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tp-color-label {
  color: #f1f5f9;
}

[data-theme="dark"] .tp-color-circle-picker {
  border-color: #334155;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 2px 5px rgba(0, 0, 0, 0.4);
}

@media (max-width: 380px) {
  .tp-text-action-buttons-grid .tp-btn {
    padding: 7px 4px !important;
    font-size: 0.76rem !important;
  }

  .tp-color-select-card {
    padding: 6px 8px;
  }

  .tp-color-label {
    font-size: 0.78rem;
  }
}

/* Text Layers Bar & Multi-Text Management */
.tp-text-layers-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin-bottom: 8px;
  scrollbar-width: thin;
}

.tp-text-layer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 16px;
  border: 1px solid var(--border-medium, #d1d5db);
  background: var(--bg-card, #ffffff);
  color: var(--text-secondary, #4b5563);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  max-width: 140px;
}

.tp-text-layer-chip:hover {
  border-color: var(--primary, #1a6a58);
  color: var(--primary, #1a6a58);
}

.tp-text-layer-chip.active {
  background: var(--primary, #1a6a58);
  border-color: var(--primary, #1a6a58);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(26, 106, 88, 0.3);
}

.tp-text-layer-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-text-layer-chip-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
  border: none;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease;
}

.tp-text-layer-chip-del:hover {
  background: rgba(220, 38, 38, 0.8);
  color: #ffffff;
}

.tp-text-layer-chip.active .tp-text-layer-chip-del {
  background: rgba(255, 255, 255, 0.25);
}

.tp-text-layer-chip.active .tp-text-layer-chip-del:hover {
  background: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .tp-text-layer-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

[data-theme="dark"] .tp-text-layer-chip.active {
  background: var(--primary, #2da88a);
  border-color: var(--primary, #2da88a);
  color: #0f172a;
  font-weight: 700;
}

.tp-editor-extra-text-overlay {
  cursor: pointer !important;
}

.tp-editor-extra-text-overlay:hover {
  border: 1.5px dashed var(--primary, #1a6a58) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

/* Image Editor Font Family Selector & Option Previews */
#text-font-family optgroup {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--brand-green, #1a6a58);
  background: var(--bg-surface, #ffffff);
  padding: 4px 0;
}

#text-font-family option {
  padding: 6px 10px;
  font-size: 0.95rem;
  color: var(--text-primary, #111111);
  background: var(--bg-card, #ffffff);
}

#text-font-family option[value*="Inter"] {
  font-family: 'Inter', sans-serif;
}

#text-font-family option[value*="Roboto"] {
  font-family: 'Roboto', sans-serif;
}

#text-font-family option[value*="Poppins"] {
  font-family: 'Poppins', sans-serif;
}

#text-font-family option[value*="Montserrat"] {
  font-family: 'Montserrat', sans-serif;
}

#text-font-family option[value*="Oswald"] {
  font-family: 'Oswald', sans-serif;
}

#text-font-family option[value*="Impact"] {
  font-family: 'Impact', sans-serif;
}

#text-font-family option[value*="Bebas"] {
  font-family: 'Bebas Neue', sans-serif;
}

#text-font-family option[value*="Anton"] {
  font-family: 'Anton', sans-serif;
}

#text-font-family option[value*="Bangers"] {
  font-family: 'Bangers', cursive;
}

#text-font-family option[value*="Arial Black"] {
  font-family: 'Arial Black', sans-serif;
}

#text-font-family option[value*="Playfair"] {
  font-family: 'Playfair Display', serif;
}

#text-font-family option[value*="Cinzel"] {
  font-family: 'Cinzel', serif;
}

#text-font-family option[value*="Georgia"] {
  font-family: 'Georgia', serif;
}

#text-font-family option[value*="Pacifico"] {
  font-family: 'Pacifico', cursive;
}

#text-font-family option[value*="Great Vibes"] {
  font-family: 'Great Vibes', cursive;
  font-size: 1.15rem;
}

#text-font-family option[value*="Caveat"] {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
}

#text-font-family option[value*="Permanent Marker"] {
  font-family: 'Permanent Marker', cursive;
}

#text-font-family option[value*="Lobster"] {
  font-family: 'Lobster', cursive;
}

#text-font-family option[value*="Courier New"] {
  font-family: 'Courier New', monospace;
}

#text-font-family option[value*="Mandali"] {
  font-family: 'Mandali', sans-serif;
}

#text-font-family option[value*="Ramabhadra"] {
  font-family: 'Ramabhadra', sans-serif;
}

#text-font-family option[value*="Gurajada"] {
  font-family: 'Gurajada', serif;
}

#text-font-family option[value*="Gidugu"] {
  font-family: 'Gidugu', sans-serif;
}

[data-theme="dark"] #text-font-family optgroup {
  color: #5eead4;
  background: #1e293b;
}

[data-theme="dark"] #text-font-family option {
  color: #f1f5f9;
  background: #0f172a;
}

/* ==========================================================================
   SIP CALCULATOR STYLES
   ========================================================================== */
.tp-sip-wrap {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 0 32px;
  box-sizing: border-box;
}

/* Strategy Mode Navigation Pills */
.tp-sip-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  background: var(--bg-surface-alt, #F9F8F4);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: var(--r-lg, 16px);
  margin-bottom: 24px;
  scrollbar-width: thin;
}

.tp-sip-tab-btn {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--r-md, 12px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, rgba(17, 17, 17, 0.65));
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  user-select: none;
}

.tp-sip-tab-btn:hover {
  color: var(--brand-green, #1a6a58);
  background: rgba(26, 106, 88, 0.05);
}

.tp-sip-tab-btn.active {
  background: var(--bg-surface, #ffffff);
  color: var(--brand-green, #1a6a58);
  border-color: var(--border-light, rgba(17, 17, 17, 0.1));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .tp-sip-tab-btn.active {
  background: var(--bg-card, #1e293b);
  color: #10b981;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Main Two-Column Layout */
.tp-sip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 22px;
  margin-bottom: 28px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tp-sip-grid>* {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 960px) {
  .tp-sip-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Input Card */
.tp-sip-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: var(--r-lg, 16px);
  padding: 24px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Enhanced Input Field Structure & Modern Typography */
.tp-sip-field {
  margin-bottom: 20px;
  position: relative;
  min-width: 0;
}

.tp-sip-field:last-of-type {
  margin-bottom: 10px;
}

.tp-sip-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.tp-sip-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary, #111111);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

/* Modern Interactive Input Pill Badge */
.tp-sip-val-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface-alt, #F9F8F4);
  border: 1.5px solid var(--border-mid, rgba(17, 17, 17, 0.18));
  border-radius: var(--r-md, 10px);
  padding: 5px 10px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-green, #1a6a58);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: text;
  flex-shrink: 0;
}

.tp-sip-val-badge:hover {
  border-color: var(--brand-green, #1a6a58);
  background: var(--bg-surface, #ffffff);
}

.tp-sip-val-badge:focus-within {
  border-color: var(--brand-green, #1a6a58);
  background: var(--bg-surface, #ffffff);
  box-shadow: 0 0 0 3px rgba(26, 106, 88, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tp-sip-val-badge .tp-sip-affix {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted, rgba(17, 17, 17, 0.48));
  user-select: none;
  padding: 0 2px;
}

.tp-sip-val-badge input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-green, #1a6a58);
  text-align: right;
  width: 88px;
  outline: none;
  padding: 0 2px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.tp-sip-val-badge input[id*="rate"] {
  width: 44px;
}

.tp-sip-val-badge input[id*="tenure"],
.tp-sip-val-badge input[id*="years"],
.tp-sip-val-badge input[id*="step"] {
  width: 38px;
}

.tp-sip-val-badge input::-webkit-outer-spin-button,
.tp-sip-val-badge input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Premium Custom Range Slider */
.tp-sip-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--r-pill, 9999px);
  background: linear-gradient(90deg, rgba(26, 106, 88, 0.25) 0%, rgba(26, 106, 88, 0.12) 100%);
  outline: none;
  margin: 12px 0 10px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.tp-sip-slider:hover {
  background: linear-gradient(90deg, rgba(26, 106, 88, 0.35) 0%, rgba(26, 106, 88, 0.18) 100%);
}

/* WebKit Slider Thumb */
.tp-sip-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-green, #1a6a58);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  cursor: grab;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease, background 0.15s ease;
}

.tp-sip-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 3px 10px rgba(26, 106, 88, 0.45);
}

.tp-sip-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.24);
  box-shadow: 0 4px 14px rgba(26, 106, 88, 0.55);
}

/* Firefox Slider Thumb */
.tp-sip-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-green, #1a6a58);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  cursor: grab;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
}

.tp-sip-slider::-moz-range-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 3px 10px rgba(26, 106, 88, 0.45);
}

.tp-sip-slider:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.24);
  box-shadow: 0 4px 14px rgba(26, 106, 88, 0.55);
}

/* Quick Selection Chips — Single-Row Horizontal Scrollable */
.tp-sip-chips {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  gap: 7px;
  margin-top: 8px;
  padding: 4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tp-sip-chips::-webkit-scrollbar {
  height: 4px;
}

.tp-sip-chips::-webkit-scrollbar-track {
  background: transparent;
}

.tp-sip-chips::-webkit-scrollbar-thumb {
  background: var(--border-mid, rgba(17, 17, 17, 0.18));
  border-radius: 4px;
}

.tp-sip-chip {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 5px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--r-pill, 9999px);
  background: var(--bg-surface-alt, #F9F8F4);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.14));
  color: var(--text-secondary, rgba(17, 17, 17, 0.7));
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tp-sip-chip:hover {
  background: var(--brand-green-lite, #e9f4f1);
  color: var(--brand-green, #1a6a58);
  border-color: rgba(26, 106, 88, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(26, 106, 88, 0.12);
}

.tp-sip-chip.active {
  background: var(--brand-green, #1a6a58) !important;
  color: #ffffff !important;
  border-color: var(--brand-green, #1a6a58) !important;
  font-weight: 700;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(26, 106, 88, 0.32);
}

/* Dark Mode Input Field Styles */
[data-theme="dark"] .tp-sip-val-badge {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  color: #34d399;
}

[data-theme="dark"] .tp-sip-val-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #34d399;
}

[data-theme="dark"] .tp-sip-val-badge:focus-within {
  background: rgba(255, 255, 255, 0.1);
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}

[data-theme="dark"] .tp-sip-val-badge input {
  color: #34d399;
}

[data-theme="dark"] .tp-sip-val-badge .tp-sip-affix {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .tp-sip-slider {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.35) 0%, rgba(255, 255, 255, 0.12) 100%);
}

[data-theme="dark"] .tp-sip-slider::-webkit-slider-thumb {
  background: #10b981;
  border-color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .tp-sip-slider::-moz-range-thumb {
  background: #10b981;
  border-color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .tp-sip-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .tp-sip-chip:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

[data-theme="dark"] .tp-sip-chip.active {
  background: var(--brand-green) !important;
  color: #ffffff !important;
  border-color: var(--brand-green) !important;
  box-shadow: var(--shadow-green);
}

/* Results Hero Cards */
.tp-sip-results-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.tp-sip-hero-stat {
  background: linear-gradient(135deg, rgba(26, 106, 88, 0.08) 0%, rgba(26, 106, 88, 0.02) 100%);
  border: 1px solid rgba(26, 106, 88, 0.2);
  border-radius: var(--r-lg, 16px);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}

.tp-sip-hero-stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, rgba(17, 17, 17, 0.45));
}

.tp-sip-hero-stat-val {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--brand-green, #1a6a58);
  line-height: 1.2;
  margin: 6px 0;
  word-break: break-word;
}

[data-theme="dark"] .tp-sip-hero-stat-val {
  color: #34d399;
}

.tp-sip-hero-stat-sub {
  font-size: 0.88rem;
  color: var(--text-secondary, rgba(17, 17, 17, 0.65));
  font-weight: 600;
  word-break: break-word;
}

/* Metric Stats Row */
.tp-sip-stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.tp-sip-stat-item {
  background: var(--bg-surface-alt, #F9F8F4);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: var(--r-md, 12px);
  padding: 13px 14px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.tp-sip-stat-item.highlight-gain {
  border-color: rgba(232, 137, 42, 0.4);
  background: rgba(232, 137, 42, 0.05);
}

.tp-sip-stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted, rgba(17, 17, 17, 0.45));
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-sip-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #111111);
  word-break: break-word;
}

.tp-sip-stat-desc {
  font-size: 0.72rem;
  color: var(--text-secondary, rgba(17, 17, 17, 0.65));
  margin-top: 3px;
  line-height: 1.3;
  word-break: break-word;
}

/* Donut Chart Container */
.tp-sip-chart-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  padding: 12px 0;
}

@media (max-width: 500px) {
  .tp-sip-chart-box {
    flex-direction: column;
  }
}

.tp-sip-donut-svg {
  width: 170px;
  height: 170px;
  transform: rotate(-90deg);
}

.tp-sip-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-sip-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

.tp-sip-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Milestones and Crossover Box */
.tp-sip-magic-box {
  background: linear-gradient(135deg, rgba(232, 137, 42, 0.08) 0%, rgba(232, 137, 42, 0.02) 100%);
  border: 1px dashed rgba(232, 137, 42, 0.4);
  border-radius: var(--r-md, 12px);
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary, #111111);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Yearly Growth Bar Chart */
.tp-sip-growth-chart-wrap {
  width: 100%;
  margin-top: 16px;
  background: var(--bg-surface-alt, #F9F8F4);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: var(--r-lg, 16px);
  padding: 20px;
}

.tp-sip-chart-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* Amortization Table */
.tp-sip-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: var(--r-md, 12px);
  margin-top: 16px;
  max-height: 420px;
  overflow-y: auto;
}

.tp-sip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: right;
  white-space: nowrap;
}

.tp-sip-table th {
  background: var(--bg-surface-alt, #F9F8F4);
  color: var(--text-secondary, rgba(17, 17, 17, 0.65));
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-mid, rgba(17, 17, 17, 0.15));
  position: sticky;
  top: 0;
  z-index: 2;
}

.tp-sip-table th:first-child,
.tp-sip-table td:first-child {
  text-align: left;
}

.tp-sip-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  color: var(--text-primary, #111111);
}

.tp-sip-table tr:hover td {
  background: rgba(26, 106, 88, 0.04);
}

/* Action Toolbar */
.tp-sip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ==========================================================================
   LOAN & EMI SCHEDULE CALCULATOR STYLES
   ========================================================================== */
.tp-emi-wrap {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 0 32px;
  box-sizing: border-box;
}

/* Loan Type Preset Selector */
.tp-emi-presets {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scrollbar-width: thin;
}

.tp-emi-preset-btn {
  padding: 7px 16px;
  border-radius: var(--r-pill, 9999px);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  background: var(--bg-surface, #ffffff);
  color: var(--text-secondary, rgba(17, 17, 17, 0.65));
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tp-emi-preset-btn:hover {
  border-color: var(--brand-green, #1a6a58);
  color: var(--brand-green, #1a6a58);
}

.tp-emi-preset-btn.active {
  background: var(--brand-green, #1a6a58);
  color: #ffffff;
  border-color: var(--brand-green, #1a6a58);
}

/* Prepayment Drawer Box */
.tp-emi-prepay-card {
  background: rgba(232, 137, 42, 0.04);
  border: 1px dashed rgba(232, 137, 42, 0.4);
  border-radius: var(--r-md, 12px);
  padding: 16px;
  margin-top: 16px;
}

.tp-emi-savings-banner {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.12) 0%, rgba(22, 163, 74, 0.04) 100%);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: var(--r-md, 12px);
  padding: 14px 18px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-emi-savings-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Month/Year Schedule Tab Switcher */
.tp-emi-schedule-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-surface-alt, #F9F8F4);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: var(--r-pill, 9999px);
}

.tp-emi-schedule-btn {
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--r-pill, 9999px);
  border: none;
  background: transparent;
  color: var(--text-secondary, rgba(17, 17, 17, 0.65));
  cursor: pointer;
  transition: all 0.15s ease;
}

.tp-emi-schedule-btn.active {
  background: var(--bg-surface, #ffffff);
  color: var(--brand-green, #1a6a58);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .tp-emi-schedule-btn.active {
  background: var(--bg-card, #1e293b);
  color: #34d399;
}

/* Prepayment Strategy Segmented Radio */
.tp-emi-strategy-group {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.tp-emi-strategy-card {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  background: var(--bg-surface, #ffffff);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tp-emi-strategy-card:hover {
  border-color: var(--brand-green, #1a6a58);
}

.tp-emi-strategy-card.active {
  border-color: var(--brand-green, #1a6a58);
  background: rgba(26, 106, 88, 0.05);
}

.tp-emi-strategy-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary, #111111);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tp-emi-strategy-desc {
  font-size: 0.76rem;
  color: var(--text-muted, rgba(17, 17, 17, 0.5));
}

/* Loan Comparison Badge */
.tp-emi-tag-saved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-pill, 9999px);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS FOR EMI & FINANCIAL CALCULATORS (<= 768px, <= 480px, <= 360px)
   ========================================================================== */
@media (max-width: 900px) {
  .tp-sip-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {

  .tp-emi-wrap,
  .tp-sip-wrap {
    width: 100%;
    max-width: 100%;
    padding: 0 0 24px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .tp-sip-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
    min-width: 0;
    width: 100%;
  }

  .tp-sip-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 18px 14px;
    border-radius: 14px;
    overflow: hidden;
  }

  /* 1. Strategy Navigation Pills (SIP) */
  .tp-sip-nav {
    padding: 5px;
    gap: 6px;
    border-radius: 12px;
    margin-bottom: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .tp-sip-nav::-webkit-scrollbar {
    display: none;
  }

  .tp-sip-tab-btn {
    min-width: unset;
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 0.8rem;
    gap: 6px;
    border-radius: 8px;
    white-space: nowrap;
  }

  /* 2. Preset Selector Pills (EMI) */
  .tp-emi-presets {
    padding: 4px 2px 12px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .tp-emi-presets::-webkit-scrollbar {
    display: none;
  }

  .tp-emi-preset-btn {
    flex: 0 0 auto;
    padding: 7px 13px;
    font-size: 0.78rem;
    gap: 5px;
    white-space: nowrap;
  }

  /* 3. Fields & Badges */
  .tp-sip-field {
    margin-bottom: 18px;
  }

  .tp-sip-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
  }

  .tp-sip-label {
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .tp-sip-val-badge {
    font-size: 0.88rem;
    padding: 4px 8px;
    border-radius: 6px;
  }

  .tp-sip-val-badge input {
    font-size: 0.88rem;
    width: 80px;
  }

  .tp-sip-chips {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    gap: 6px;
    margin-top: 6px;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tp-sip-chips::-webkit-scrollbar {
    display: none;
  }

  .tp-sip-chip {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 5px 11px;
    font-size: 0.75rem;
    min-height: 28px;
    display: inline-flex !important;
    align-items: center;
    touch-action: manipulation;
  }

  .tp-emi-flat-notice {
    display: flex;
    background: rgba(232, 137, 42, 0.08);
    border: 1px solid rgba(232, 137, 42, 0.3);
    border-radius: var(--r-md, 12px);
    padding: 10px 14px;
    margin-bottom: 16px;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    color: var(--text-primary, #111111);
  }

  [data-theme="dark"] .tp-emi-flat-notice {
    background: rgba(232, 137, 42, 0.15);
    border-color: rgba(232, 137, 42, 0.4);
  }

  /* 4. EMI Strategy Group & Prepay Card */
  .tp-emi-strategy-group {
    flex-direction: column;
    gap: 8px;
  }

  .tp-emi-strategy-card {
    padding: 10px 12px;
  }

  .tp-emi-prepay-card {
    padding: 14px 12px;
  }

  /* 5. Hero Stat Results Card */
  .tp-sip-hero-stat {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .tp-sip-hero-stat-label {
    font-size: 0.8rem;
  }

  .tp-sip-hero-stat-val {
    font-size: clamp(1.75rem, 6.5vw, 2.2rem);
    line-height: 1.15;
    word-break: break-word;
    margin: 5px 0;
  }

  .tp-sip-hero-stat-sub {
    font-size: 0.82rem;
    line-height: 1.4;
  }

  /* 6. Metric Stats Row */
  .tp-sip-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tp-sip-stat-item {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .tp-sip-stat-label {
    font-size: 0.74rem;
  }

  .tp-sip-stat-val {
    font-size: 1.05rem;
  }

  /* 7. Donut Chart Box & Legend */
  .tp-sip-chart-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 8px 0;
  }

  .tp-sip-donut-svg {
    width: 145px;
    height: 145px;
  }

  .tp-sip-legend {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
  }

  .tp-sip-legend-item {
    font-size: 0.82rem;
    gap: 6px;
  }

  /* 8. Yearly Growth Chart */
  .tp-sip-growth-chart-wrap {
    padding: 16px 12px;
    margin-top: 14px;
    border-radius: 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .tp-sip-chart-title-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
  }

  #sip-scenarios-box {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #sip-chart-container {
    height: 190px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #sip-growth-svg {
    height: 190px;
  }

  /* 9. Amortization Table on Mobile */
  .tp-sip-table-wrap {
    width: 100%;
    max-height: 380px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    margin-top: 12px;
    border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  }

  .tp-sip-table {
    font-size: 0.78rem;
  }

  .tp-sip-table th,
  .tp-sip-table td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  /* Sticky first column (Year / Month) so user never loses context while scrolling horizontally */
  .tp-sip-table th:first-child,
  .tp-sip-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--bg-surface, #ffffff);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06);
  }

  .tp-sip-table th:first-child {
    z-index: 5;
    background: var(--bg-surface-alt, #F9F8F4);
  }

  [data-theme="dark"] .tp-sip-table td:first-child {
    background: var(--bg-card, #1e293b);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.3);
  }

  [data-theme="dark"] .tp-sip-table th:first-child {
    background: #0f172a;
  }

  /* 10. Action Toolbar */
  .tp-sip-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 16px;
  }

  .tp-sip-actions .tp-btn {
    width: 100% !important;
    min-height: 42px !important;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
    white-space: normal !important;
    text-align: center !important;
    justify-content: center !important;
    line-height: 1.25 !important;
  }
}

/* --------------------------------------------------------------------------
   COMPACT & STANDARD PHONES (<= 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .tp-sip-card {
    padding: 14px 12px;
  }

  .tp-sip-hero-stat {
    padding: 14px 10px;
  }

  .tp-sip-hero-stat-val {
    font-size: clamp(1.5rem, 6.8vw, 1.9rem);
  }

  .tp-sip-stats-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tp-sip-actions {
    grid-template-columns: 1fr;
  }

  .tp-sip-actions .tp-btn {
    min-height: 44px !important;
    font-size: 0.82rem !important;
  }

  .tp-emi-savings-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .tp-sip-legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-left: 14px;
  }

  /* Schedule switcher toggle in table section */
  .tp-emi-schedule-toggle {
    width: 100%;
    display: flex;
  }

  .tp-emi-schedule-btn {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   EXTRA COMPACT PHONES (<= 360px: iPhone SE1, Folded Screens)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .tp-sip-card {
    padding: 12px 8px;
  }

  .tp-sip-val-badge {
    font-size: 0.8rem;
    padding: 3px 6px;
  }

  .tp-sip-val-badge input {
    width: 66px;
    font-size: 0.8rem;
  }

  .tp-sip-chip {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .tp-sip-tab-btn {
    padding: 6px 10px;
    font-size: 0.74rem;
  }

  .tp-emi-preset-btn {
    padding: 5px 10px;
    font-size: 0.74rem;
  }

  .tp-sip-hero-stat-val {
    font-size: 1.45rem;
  }
}

/* ==========================================================================
   LOCK PDF & SECURITY TOOLS STYLES
   ========================================================================== */
.tp-pwd-strength-wrap {
  margin-top: 8px;
}

.tp-pwd-strength-track {
  height: 4px;
  width: 100%;
  background: var(--border-light, rgba(17, 17, 17, 0.1));
  border-radius: var(--r-pill, 9999px);
  overflow: hidden;
}

.tp-pwd-strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--r-pill, 9999px);
}

.tp-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tp-perm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  background: var(--bg-surface-alt, #F9F8F4);
  padding: 10px 14px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  transition: all 0.15s ease;
  user-select: none;
}

.tp-perm-item:hover {
  border-color: var(--brand-green, #1a6a58);
  background: rgba(26, 106, 88, 0.04);
}

[data-theme="dark"] .tp-perm-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tp-perm-item:hover {
  background: rgba(52, 211, 153, 0.08);
  border-color: #10b981;
}

/* ==========================================================================
   UX ENHANCEMENTS: PDF THUMBNAIL GRIDS, COMPARISON SLIDER & AUDIO ZOOM
   ========================================================================== */

/* 1. PDF Split Thumbnail Cards */
.tp-split-thumb-card {
  position: relative;
  background: var(--bg-card, #ffffff);
  border: 2px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xs, 0 1px 3px rgba(0, 0, 0, 0.05));
  display: flex;
  flex-direction: column;
}

.tp-split-thumb-card:hover {
  border-color: var(--primary, #1a6a58);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.08));
}

.tp-split-thumb-card.selected {
  border-color: var(--primary, #1a6a58);
  box-shadow: 0 0 0 2px var(--primary, #1a6a58), 0 4px 14px rgba(26, 106, 88, 0.2);
}

.tp-split-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg-surface, #f8fafc);
  border-bottom: 1px solid var(--border-light, rgba(0, 0, 0, 0.06));
  font-size: 0.78rem;
  font-weight: 700;
}

.tp-split-page-num {
  color: var(--text-secondary, #475569);
}

.tp-split-thumb-card.selected .tp-split-page-num {
  color: var(--primary, #1a6a58);
}

.tp-split-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border-mid, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: all 0.15s ease;
  color: transparent;
}

.tp-split-checkbox.checked {
  background: var(--primary, #1a6a58);
  border-color: var(--primary, #1a6a58);
  color: #ffffff;
}

.tp-split-preview-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.35;
  background: var(--bg-surface-alt, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}

.tp-split-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.tp-split-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Dark mode PDF Split */
[data-theme="dark"] .tp-split-thumb-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tp-split-card-header {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .tp-split-preview-wrap {
  background: #090d16;
}

[data-theme="dark"] .tp-split-checkbox {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .tp-split-checkbox.checked {
  background: var(--primary, #10b981);
  border-color: var(--primary, #10b981);
}

/* 2. Before/After Split Comparison Slider */
.tp-compare-slider-wrap {
  cursor: ew-resize;
}

.tp-compare-slider-wrap:active {
  cursor: col-resize;
}

/* 3. Voice Microphone Pulse Animation */
@keyframes tp-pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.tp-pulse {
  animation: tp-pulse-glow 1.4s infinite !important;
}

/* 4. Audio Waveform Zoom Scroll Wrapper */
#aud-wave-scroll-wrap::-webkit-scrollbar {
  height: 6px;
}

#aud-wave-scroll-wrap::-webkit-scrollbar-track {
  background: #0b0f19;
}

#aud-wave-scroll-wrap::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

#aud-wave-scroll-wrap::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ==========================================================================
   5. MOBILE RESPONSIVENESS OPTIMIZATIONS ACROSS ALL ENHANCED TOOLS
   ========================================================================== */

/* QR Code Generator Mobile Layout */
#qr-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}

.tp-qr-presets {
  display: flex !important;
  gap: 8px;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.tp-qr-presets::-webkit-scrollbar {
  display: none;
}

.tp-qr-presets .tp-chip {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 768px) {
  #qr-main-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  #qr-main-grid .tp-card {
    padding: 16px !important;
  }
}

@media (max-width: 480px) {
  #qr-styling-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  #qr-styling-grid .tp-form-group:last-child {
    grid-column: span 2;
  }

  .tp-qr-two-col-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .tp-qr-wa-grid {
    grid-template-columns: 80px 1fr !important;
    gap: 8px !important;
  }
}

/* Multi-Language Translator Mobile Layout */
#trans-boxes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 768px) {
  #trans-boxes-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  #trans-boxes-grid .tp-panel-box {
    width: 100% !important;
  }

  #trans-boxes-grid textarea {
    min-height: 150px;
  }
}

@media (max-width: 600px) {

  /* Translator Controls Bar */
  .tp-tool-inner #trans-source-lang,
  .tp-tool-inner #trans-target-lang {
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 120px !important;
  }

  .tp-panel-footer {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .tp-panel-footer-actions {
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
    display: flex !important;
  }

  .tp-panel-footer-actions .tp-btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }
}

/* PDF Split & Merge Mobile Layout */
@media (max-width: 640px) {
  #pdf-split-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)) !important;
    gap: 10px !important;
    max-height: 380px !important;
    padding: 8px !important;
  }

  .tp-split-thumb-card {
    min-width: 0;
  }

  .tp-split-card-header {
    padding: 4px 6px;
    font-size: 0.72rem;
  }

  .tp-split-checkbox {
    width: 16px;
    height: 16px;
  }

  .tp-merge-card {
    flex-wrap: wrap;
    gap: 10px;
  }

  .tp-merge-card .tp-file-info {
    flex: 1 1 100%;
  }

  #pdf-merge-summary {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }
}

/* Split PDF Action Buttons & Icons */
.tp-split-actions .tp-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#pdf-split-dl-btn svg,
#pdf-split-dl-btn .tp-btn-icon-dl {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 2.3px !important;
  vertical-align: middle !important;
  margin-right: 9px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

@media (max-width: 768px) {
  #pdf-split-dl-btn svg,
  #pdf-split-dl-btn .tp-btn-icon-dl {
    width: 23px !important;
    height: 23px !important;
    stroke-width: 2.4px !important;
    margin-right: 10px !important;
  }
}

@media (max-width: 580px) {
  .tp-split-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .tp-split-actions .tp-btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 1rem !important;
    padding: 13px 18px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  #pdf-split-dl-btn {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
  }

  #pdf-split-dl-btn svg,
  #pdf-split-dl-btn .tp-btn-icon-dl {
    width: 24px !important;
    height: 24px !important;
    stroke-width: 2.4px !important;
    margin-right: 10px !important;
  }
}

@media (max-width: 380px) {
  #pdf-split-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

/* Passport Photo Resizer Mobile Layout */
.tp-passport-preset-card {
  width: 100%;
  box-sizing: border-box;
}

.tp-passport-canvas-wrapper {
  max-width: 100% !important;
  height: auto !important;
}

.tp-passport-canvas-wrapper canvas {
  max-width: 100% !important;
  height: auto !important;
}

@media (max-width: 580px) {
  .tp-passport-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .tp-passport-actions .tp-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Audio Cutter Mobile Layout */
@media (max-width: 580px) {
  #aud-cut-controls .tp-form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #aud-wave-container {
    height: 120px !important;
  }

  #aud-handle-start,
  #aud-handle-end {
    touch-action: none;
  }

  #aud-handle-start::after,
  #aud-handle-end::after {
    content: '';
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: -16px;
    right: -16px;
  }

  #aud-btn-play-selection {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Image Compressor Mobile Layout */
#compress-split-container {
  width: 100% !important;
  max-width: 620px;
  touch-action: none;
}

@media (max-width: 640px) {
  #compress-split-container img {
    max-height: 280px !important;
  }

  #compress-preview-box>div {
    flex-direction: column !important;
    align-items: center;
  }

  #compress-view-split-btn,
  #compress-view-side-btn {
    font-size: 0.78rem !important;
    padding: 6px 10px !important;
  }
}

@media (max-width: 480px) {
  #compress-split-container {
    border-radius: 8px !important;
  }

  #compress-split-container img {
    max-height: 230px !important;
  }

  #compress-dl-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (max-width: 440px) {
  #compress-target-group>div {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  #compress-target-range {
    width: 100% !important;
  }
}

/* Video to Audio Mobile Layout */
@media (max-width: 540px) {
  #vid-clip-inputs-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #vid-extract-btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.92rem !important;
    padding: 10px 14px !important;
    white-space: normal !important;
    text-align: center !important;
  }
}

/* ==========================================================================
   GENERIC COPY PREVIEW MODAL — Universal, Accessible & 100% Mobile Responsive
   ========================================================================== */
.tp-modal-backdrop#tp-copy-modal {
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.tp-copy-modal-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-2xl);
  width: 100%;
  max-width: 580px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: tp-copy-modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tp-copy-modal-in {
  from {
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.tp-copy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.tp-copy-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tp-copy-modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--r-lg);
  background: var(--brand-green-lite);
  color: var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .tp-copy-modal-icon-badge {
  background: rgba(52, 211, 153, 0.16);
  color: var(--primary);
}

.tp-copy-modal-header-text {
  min-width: 0;
}

.tp-copy-modal-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-copy-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 3px 0 0 0;
  line-height: 1.3;
}

.tp-copy-modal-close-btn {
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--ease-fast);
  flex-shrink: 0;
}

.tp-copy-modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tp-copy-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
  flex-wrap: wrap;
}

.tp-copy-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border-light);
}

.tp-copy-stat-pill svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.tp-copy-meta-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-copy-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: var(--ease-fast);
}

.tp-copy-action-chip:hover {
  background: var(--bg-hover);
  color: var(--brand-green);
  border-color: var(--brand-green);
}

[data-theme="dark"] .tp-copy-action-chip:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.tp-copy-action-chip svg {
  flex-shrink: 0;
}

.tp-copy-modal-body {
  padding: 14px 20px;
}

.tp-copy-modal-textarea {
  width: 100%;
  min-height: 180px;
  max-height: 45vh;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border-mid);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 0.88rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.tp-copy-modal-textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(26, 106, 88, 0.14);
}

[data-theme="dark"] .tp-copy-modal-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.tp-copy-modal-textarea::selection {
  background: rgba(26, 106, 88, 0.25);
  color: inherit;
}

[data-theme="dark"] .tp-copy-modal-textarea::selection {
  background: rgba(52, 211, 153, 0.3);
  color: inherit;
}

.tp-copy-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-light);
  gap: 12px;
}

.tp-copy-footer-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tp-copy-footer-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-copy-cancel-btn {
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--r-md);
}

.tp-copy-confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--r-md);
  transition: all 0.2s ease;
  min-height: 40px;
}

.tp-copy-confirm-btn.copied {
  background: var(--brand-green-mid, #1d7a65) !important;
  color: #ffffff !important;
  border-color: var(--brand-green-mid, #1d7a65) !important;
  box-shadow: 0 4px 16px rgba(26, 106, 88, 0.35);
}

[data-theme="dark"] .tp-copy-confirm-btn.copied {
  background: var(--brand-green, #34d399) !important;
  color: #0d0d0b !important;
  border-color: var(--brand-green, #34d399) !important;
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.35);
}

/* Mobile Responsiveness for Copy Preview Modal */
@media (max-width: 640px) {
  .tp-modal-backdrop#tp-copy-modal {
    padding: 16px 14px;
    align-items: center;
    /* Centered in mobile view */
    justify-content: center;
  }

  .tp-copy-modal-card {
    max-width: 100%;
    margin: auto;
    border-radius: var(--r-xl);
    max-height: 88vh;
  }

  .tp-copy-modal-header {
    padding: 12px 16px;
  }

  .tp-copy-modal-icon-badge {
    width: 36px;
    height: 36px;
  }

  .tp-copy-modal-title {
    font-size: 0.98rem;
  }

  .tp-copy-modal-subtitle {
    font-size: 0.74rem;
  }

  .tp-copy-modal-toolbar {
    padding: 8px 16px;
    gap: 6px;
  }

  .tp-copy-stat-pill {
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  .tp-copy-action-chip {
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  .tp-copy-modal-body {
    padding: 10px 16px;
  }

  .tp-copy-modal-textarea {
    min-height: 140px;
    max-height: 38vh;
    font-size: 0.84rem;
    padding: 10px 12px;
  }

  .tp-copy-modal-footer {
    padding: 10px 16px 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .tp-copy-footer-hint {
    display: none;
    /* Hide desktop keyboard hint on mobile */
  }

  .tp-copy-footer-buttons {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .tp-copy-cancel-btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
    /* Apple & Android touch target standard */
  }

  .tp-copy-confirm-btn {
    flex: 2;
    justify-content: center;
    min-height: 44px;
    font-size: 0.92rem;
  }
}

/* ==========================================================================
   BACKGROUND REMOVER (Remove BG) STUDIO STYLING & MOBILE RESPONSIVENESS
   ========================================================================== */

.tp-checkerboard-bg {
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #ffffff;
}

[data-theme="dark"] .tp-checkerboard-bg {
  background-image:
    linear-gradient(45deg, #334155 25%, transparent 25%),
    linear-gradient(-45deg, #334155 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #334155 75%),
    linear-gradient(-45deg, transparent 75%, #334155 75%);
  background-color: #1e293b;
}

.tp-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  cursor: pointer;
  transition: transform var(--ease-fast), box-shadow var(--ease-fast), border-color var(--ease-fast);
  padding: 0;
  outline: none;
  flex-shrink: 0;
}

.tp-color-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.tp-color-swatch.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 2.5px var(--brand-green, #1a6a58), 0 2px 10px rgba(26, 106, 88, 0.35);
  border-color: #ffffff;
}

.tp-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-mid);
  cursor: pointer;
  transition: all var(--ease-fast);
  white-space: nowrap;
}

.tp-chip-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--brand-green);
}

.tp-chip-btn.active {
  background: var(--brand-green-lite);
  color: var(--brand-green);
  border-color: var(--brand-green);
  font-weight: 700;
}

.tp-removebg-canvas-container {
  position: relative;
  width: 100%;
  max-width: 880px;
  margin: 0 auto 20px;
  overflow: hidden;
  border-radius: 14px;
  border: 1.5px solid var(--border-mid);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  background: #0f172a;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

/* Backdrop & Touch-Up Grid Studio System */
.tp-rbg-section-card {
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.tp-rbg-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.tp-rbg-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tp-rbg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.tp-rbg-grid-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 8px;
  border-radius: var(--r-lg);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border-mid);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
  text-align: center;
  min-height: 64px;
  user-select: none;
}

.tp-rbg-grid-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

.tp-rbg-grid-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--brand-green);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.tp-rbg-grid-btn.active {
  background: var(--brand-green-lite);
  border-color: var(--brand-green);
  color: var(--brand-green);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--brand-green);
}

.tp-rbg-sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.tp-rbg-slider-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-rbg-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tp-rbg-slider-val {
  font-weight: 700;
  color: var(--brand-green);
  font-size: 0.82rem;
}

.tp-rbg-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.tp-rbg-actions-grid {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .tp-removebg-canvas-container {
    max-height: 440px;
  }
}

@media (max-width: 640px) {
  .tp-removebg-canvas-container {
    max-height: 380px;
    border-radius: 10px;
  }

  .tp-rbg-section-card {
    padding: 12px 14px;
  }

  .tp-rbg-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tp-rbg-grid-btn {
    padding: 10px 6px;
    font-size: 0.78rem;
    min-height: 54px;
  }

  .tp-rbg-grid-btn svg {
    width: 18px;
    height: 18px;
  }

  .tp-rbg-sliders-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #rbg-color-row {
    justify-content: center;
    gap: 8px;
  }

  .tp-chip-btn {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .tp-rbg-bottom-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .tp-rbg-bottom-bar>div:first-child {
    justify-content: center;
  }

  .tp-rbg-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .tp-rbg-actions-grid button {
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }

  #rbg-download-png-btn,
  #rbg-download-jpg-btn {
    grid-column: span 2;
  }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS SUITE FOR NEW TOOLS & WORKSPACES
   ========================================================================== */

/* Universal Tool Grid Utilities */
.tp-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.tp-three-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.tp-four-col-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {

  .tp-two-col-grid,
  #gst-main-grid,
  #gst-mode-tabs,
  #land-main-grid,
  #json-main-grid,
  #color-main-grid,
  #loan-compare-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .tp-three-col-grid,
  #collage-controls-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* JSON Formatter Mobile Adjustments */
  #json-main-grid textarea {
    min-height: 180px !important;
    font-size: 0.82rem !important;
  }

  /* Land Converter Quick Reference Table */
  #land-ref-table {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  }

  /* Tool Inner Containers & Card Padding */
  .tp-tool-inner {
    padding: 0 4px;
  }

  .tp-card {
    padding: 16px !important;
  }
}

/* Small Smartphone Screens (<= 480px) */
@media (max-width: 480px) {

  .tp-four-col-grid,
  #gst-rate-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .tp-case-btn-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .tp-case-btn-grid button {
    font-size: 0.78rem !important;
    padding: 8px 6px !important;
  }

  /* Loan Comparison Summary Statistics */
  .tp-loan-stat-grid,
  #lc-comparison>div:first-of-type {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Resizer Controls */
  #resizer-pixel-controls>div {
    grid-template-columns: 1fr auto 1fr !important;
    gap: 6px !important;
  }

  #resizer-w,
  #resizer-h {
    font-size: 0.85rem !important;
    padding: 6px 8px !important;
  }

  /* PDF Compressor Chips */
  #pdfcomp-chips .tp-chip {
    width: 100%;
    text-align: center;
  }

  /* PDF to Images Thumbnails */
  #pdf2img-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }


}

/* ==========================================================================
   PDF WATERMARK LIVE PREVIEW & CONTROLS
   ========================================================================== */
.tp-wm-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
}

@media (max-width: 960px) {
  .tp-wm-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tp-wm-controls-card {
    padding: 16px;
    gap: 14px;
  }

  .tp-wm-preview-card {
    padding: 14px 10px;
    min-height: auto;
  }

  .tp-wm-preview-viewport {
    padding: 14px 6px;
    min-height: 260px;
  }
}

@media (max-width: 480px) {
  .tp-wm-controls-card {
    padding: 14px 10px;
    border-radius: var(--r-lg);
  }

  .tp-wm-chip {
    padding: 5px 9px;
    font-size: 0.76rem;
  }

  .tp-wm-color-btn {
    width: 26px;
    height: 26px;
  }

  .tp-wm-preview-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

.tp-wm-controls-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.tp-wm-preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  min-height: 480px;
}

.tp-wm-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 10px;
}

.tp-wm-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

.tp-wm-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 0 2px rgba(26, 106, 88, 0.2);
  animation: tp-pulse 2s infinite ease-in-out;
}

@keyframes tp-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(0.9);
    opacity: 0.7;
  }
}

.tp-wm-preview-viewport {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--r-md);
  padding: 24px 16px;
  overflow: auto;
  min-height: 440px;
  position: relative;
}

#pdf-wm-preview-canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: #ffffff;
  display: block;
}

.tp-wm-color-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-wm-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform var(--ease-fast), border-color var(--ease-fast);
}

.tp-wm-color-btn:hover {
  transform: scale(1.15);
}

.tp-wm-color-btn.active {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--brand-green);
}

.tp-wm-chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-wm-chip {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease-fast);
}

.tp-wm-chip:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
}

.tp-wm-chip.active {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #ffffff;
}

/* ==========================================================================
   IMAGE FORMAT CONVERTER — Modern, High-Conversion Responsive Architecture
   ========================================================================== */

/* Dropzone styling adjustments */
.tp-conv-dropzone {
  padding: 38px 20px;
}

.tp-conv-drop-icon {
  color: var(--brand-green);
  margin-bottom: 12px;
}

.tp-conv-drop-btn {
  margin: 14px 0 16px;
  min-width: 180px;
}

.tp-conv-format-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tp-conv-format-tag {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* Converter Controls Bar */
.tp-conv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
}

.tp-conv-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-conv-count-badge {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.tp-conv-size-badge {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tp-conv-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-conv-link-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  transition: all var(--ease-fast);
}

.tp-conv-link-btn:hover {
  color: var(--brand-green);
  background: var(--bg-card);
}

.tp-conv-link-danger:hover {
  color: var(--danger);
}

.tp-conv-bar-sep {
  color: var(--border-mid);
  font-size: 0.8rem;
}

/* Action Box: Select + Convert Button */
.tp-conv-action-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.tp-conv-target-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tp-conv-target-label {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.tp-conv-select {
  flex: 1;
  min-width: 0;
  height: 42px;
  font-size: 0.9rem !important;
  font-weight: 600;
}

.tp-conv-main-btn {
  height: 42px;
  padding: 0 20px;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* File Cards List */
.tp-conv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

/* Individual File Card */
.tp-conv-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.tp-conv-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-sm);
}

/* Thumbnail Box with transparency grid pattern */
.tp-conv-thumb-box {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  background-color: var(--bg-surface-alt);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tp-conv-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tp-conv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-conv-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tp-conv-filename {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.tp-conv-del-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 0;
  flex-shrink: 0;
  transition: all var(--ease-fast);
}

.tp-conv-del-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.tp-conv-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tp-conv-meta-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.tp-conv-pill-src {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.tp-conv-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.tp-conv-pill-tgt {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--brand-green-lite);
  color: var(--brand-green);
  border: 1px solid rgba(26, 106, 88, 0.2);
}

.tp-conv-meta-size {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.tp-conv-diff-pill {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.tp-conv-diff-pill.larger {
  color: var(--text-muted);
  background: var(--bg-input);
}

.tp-conv-action-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tp-conv-action-btn {
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
}

.tp-conv-spinner-text {
  font-size: 0.78rem;
  color: var(--brand-green);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tp-spinner-sm {
  width: 16px;
  height: 16px;
  border: 2.2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: tp-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.tp-spinner-xs {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(26, 106, 88, 0.2);
  border-top-color: var(--brand-green);
  border-radius: 50%;
  animation: tp-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* Footer Action Buttons */
.tp-conv-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .tp-conv-thumb-box {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
}

[data-theme="dark"] .tp-conv-count-badge {
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
}

[data-theme="dark"] .tp-conv-pill-tgt {
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (< 640px)
   ========================================================================== */
@media (max-width: 640px) {
  .tp-conv-dropzone {
    padding: 28px 14px;
  }

  .tp-conv-dropzone h3 {
    font-size: 1.05rem !important;
  }

  .tp-conv-drop-btn {
    width: 100%;
    max-width: 240px;
  }

  .tp-conv-bar {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .tp-conv-action-box {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .tp-conv-target-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .tp-conv-select {
    width: 100% !important;
    height: 44px;
    font-size: 16px !important;
    /* Prevents auto-zoom on iOS */
  }

  .tp-conv-main-btn {
    width: 100%;
    height: 46px;
    font-size: 0.95rem;
  }

  .tp-conv-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .tp-conv-thumb-box {
    width: 44px;
    height: 44px;
  }

  .tp-conv-filename {
    font-size: 0.85rem;
    max-width: 200px;
  }

  .tp-conv-del-btn {
    width: 32px;
    height: 32px;
  }

  .tp-conv-row-bottom {
    gap: 6px;
  }

  .tp-conv-meta-pills {
    gap: 4px;
    font-size: 0.72rem;
  }

  .tp-conv-action-btn {
    padding: 5px 12px;
    font-size: 0.82rem;
    min-height: 32px;
  }

  .tp-conv-footer-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 18px;
  }

  .tp-conv-footer-actions .tp-btn {
    width: 100%;
    height: 44px;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .tp-conv-filename {
    max-width: 150px;
  }

  .tp-conv-meta-size {
    display: none;
  }
}

/* ==========================================================================
   OVERLAY CROP MODAL — Interactive crop & trim for logo / sticker / watermarks
   ========================================================================== */
.tp-modal-backdrop#tp-overlay-crop-modal {
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.tp-overlay-crop-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-2xl);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: tp-copy-modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-overlay-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.tp-overlay-crop-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tp-overlay-crop-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--r-lg);
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-overlay-crop-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.tp-overlay-crop-subtitle {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.tp-overlay-crop-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tp-overlay-crop-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tp-overlay-crop-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.tp-overlay-crop-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0f172a;
  background-image:
    linear-gradient(45deg, #1e293b 25%, transparent 25%),
    linear-gradient(-45deg, #1e293b 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1e293b 75%),
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  padding: 16px;
  overflow: hidden;
  min-height: 250px;
  max-height: 48vh;
  user-select: none;
  touch-action: none;
}

#tp-overlay-crop-canvas {
  max-width: 100%;
  max-height: 44vh;
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  cursor: crosshair;
}

.tp-overlay-crop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  gap: 10px;
  background: var(--bg-card);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .tp-modal-backdrop#tp-overlay-crop-modal {
    padding: 12px 10px;
    align-items: center;
  }

  .tp-overlay-crop-card {
    max-width: 100%;
    border-radius: var(--r-xl);
    max-height: 92vh;
  }

  .tp-overlay-crop-header {
    padding: 10px 14px;
  }

  .tp-overlay-crop-toolbar {
    padding: 8px 14px;
    gap: 4px;
  }

  .tp-overlay-crop-stage {
    padding: 10px;
    min-height: 200px;
    max-height: 38vh;
  }

  .tp-overlay-crop-footer {
    padding: 10px 14px;
  }
}

/* ==========================================================================
   PHOTO COLLAGE STUDIO
   ========================================================================== */
.tp-collage-workspace {
  margin-top: 16px;
}

.tp-collage-card {
  padding: 20px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.tp-collage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.tp-collage-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  background: var(--bg-surface-alt);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  align-items: center;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.tp-collage-thumb-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 6px;
  min-width: 76px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.tp-collage-thumb-preview {
  width: 62px;
  height: 62px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tp-collage-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tp-collage-thumb-badge {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
  color: var(--text-muted);
}

.tp-collage-thumb-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.tp-collage-thumb-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--border-mid);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: var(--ease-fast);
}

.tp-collage-thumb-btn:hover:not(:disabled) {
  border-color: var(--brand-green);
  color: var(--brand-green);
}

.tp-collage-thumb-btn.danger {
  border-color: #fecaca;
  color: #ef4444;
}

.tp-collage-thumb-btn.danger:hover:not(:disabled) {
  background: #fef2f2;
}

.tp-collage-thumb-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.tp-collage-chips-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tp-collage-grid-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.tp-collage-bg-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.tp-collage-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.tp-collage-stage {
  padding: 20px;
  margin-top: 16px;
  text-align: center;
  background: var(--bg-surface-alt);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-light);
}

.tp-collage-stage canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 560px);
  border-radius: var(--r-md);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .tp-collage-card {
    padding: 14px;
  }

  .tp-collage-grid-controls {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .tp-collage-actions {
    flex-direction: column;
    gap: 8px;
  }

  .tp-collage-actions .tp-btn {
    width: 100%;
    justify-content: center;
  }

  .tp-collage-stage {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .tp-collage-grid-controls {
    grid-template-columns: 1fr;
  }

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

  .tp-collage-header>div:last-child {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
}

/* ==========================================================================
   NAME & DATE PHOTO MAKER, DIGITAL SIGNATURE STUDIO & TELUGU TYPING
   ========================================================================== */

/* Name & Date Studio Layout */
.tp-nd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.tp-nd-ctrl-col,
.tp-nd-stage-col {
  min-width: 0;
}

.tp-nd-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.tp-nd-style-grid .tp-btn {
  padding: 8px 6px !important;
  font-size: 0.82rem !important;
  min-height: 38px !important;
  text-align: center !important;
  justify-content: center !important;
  white-space: normal !important;
  line-height: 1.25 !important;
}

.tp-nd-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.tp-sig-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.tp-sig-chip-row .tp-chip {
  flex: 1 1 auto;
  text-align: center;
}

.tp-name-date-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f3f4f6;
  border: 1px dashed var(--border-light);
  border-radius: 10px;
  padding: 16px;
  min-height: 360px;
  overflow: hidden;
  transition: var(--ease-normal);
}

[data-theme="dark"] .tp-name-date-stage {
  background: #1e293b !important;
  border-color: #334155 !important;
}

#nd-preview-canvas {
  max-width: 100%;
  max-height: 480px;
  height: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
}

/* Digital Signature Studio Layout */
.tp-sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.tp-sig-ctrl-col,
.tp-sig-stage-col {
  min-width: 0;
}

.tp-sig-stage-wrap {
  position: relative;
  background: #f9fafb;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  touch-action: none;
  user-select: none;
  transition: var(--ease-normal);
}

[data-theme="dark"] .tp-sig-stage-wrap {
  background: #0f172a !important;
  border-color: #334155 !important;
}

#sig-pad-canvas {
  width: 100%;
  max-width: 600px;
  height: 240px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  cursor: crosshair;
  touch-action: none;
}

[data-theme="dark"] #sig-pad-canvas {
  background: #ffffff !important;
}

/* Telugu Typing Studio Layout */
.tp-telugu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.tp-quick-phrases-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tp-quick-phrases-bar::-webkit-scrollbar {
  display: none;
}

.tp-keypad-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tp-keypad-tabs .tp-chip {
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.8rem;
  padding: 6px 10px;
  white-space: nowrap;
}

/* Telugu Virtual Keypad Buttons */
.tp-keypad-btn {
  font-family: 'Gidugu', 'Gurajada', 'Ramabhadra', var(--font-sans) !important;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.tp-keypad-btn:hover {
  background: var(--brand-green-lite) !important;
  border-color: var(--brand-green) !important;
  color: var(--brand-green) !important;
  transform: translateY(-1px);
}

.tp-keypad-btn:active {
  transform: translateY(1px);
  background: var(--brand-green) !important;
  color: #ffffff !important;
}

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .tp-nd-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tp-nd-style-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .tp-nd-style-grid .tp-btn {
    padding: 7px 4px !important;
    font-size: 0.78rem !important;
  }

  .tp-collage-grid-controls {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .tp-sig-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Signature canvas placed at top on mobile so users can sign immediately */
  .tp-sig-stage-col {
    order: 1;
  }

  .tp-sig-ctrl-col {
    order: 2;
  }

  .tp-telugu-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tp-name-date-stage {
    min-height: 280px;
    padding: 12px;
  }

  #nd-preview-canvas {
    max-height: 380px;
  }

  .tp-sig-stage-wrap {
    min-height: 220px !important;
    padding: 8px !important;
  }

  #sig-pad-canvas {
    height: 210px !important;
  }

  .tp-keypad-btn {
    min-width: 36px !important;
    height: 38px !important;
    font-size: 1.08rem !important;
    padding: 0 6px !important;
  }
}

/* Small Smartphone Screens (<= 480px) */
@media (max-width: 480px) {

  /* Name & Date Studio Mobile Optimization */
  .tp-nd-presets {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .tp-nd-presets .tp-chip {
    width: 100% !important;
    text-align: center !important;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }

  .tp-nd-style-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
  }

  .tp-nd-style-grid .tp-btn {
    padding: 6px 2px !important;
    font-size: 0.72rem !important;
    min-height: 34px !important;
    letter-spacing: -0.01em !important;
  }

  .tp-nd-date-row {
    grid-template-columns: 85px 1fr !important;
    gap: 6px !important;
  }

  /* Digital Signature Studio Mobile Optimization */
  .tp-sig-chip-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .tp-sig-chip-row .tp-chip,
  .tp-sig-ctrl-col .tp-presets .tp-chip {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    text-align: center !important;
    padding: 6px 8px !important;
    font-size: 0.76rem !important;
  }

  .tp-sig-preset-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .tp-sig-spec-pill {
    font-size: 0.72rem !important;
    padding: 3px 8px !important;
    gap: 4px !important;
  }

  .tp-sig-spec-pill .tp-passport-spec-dot {
    width: 6px !important;
    height: 6px !important;
  }

  /* Background Remover Refine Grid on Mobile */
  .tp-rbg-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Focus & Study Timer Mode Buttons on Mobile */
  #timer-mode-focus,
  #timer-mode-short,
  #timer-mode-long {
    padding: 6px 8px !important;
    font-size: 0.76rem !important;
    flex: 1 1 auto;
  }

  .tp-name-date-stage {
    min-height: 240px;
    padding: 8px;
  }

  #nd-preview-canvas {
    max-height: 320px;
  }

  .tp-sig-stage-wrap {
    min-height: 200px !important;
    padding: 6px !important;
  }

  #sig-pad-canvas {
    height: 190px !important;
  }

  .tp-keypad-btn {
    min-width: 32px !important;
    height: 34px !important;
    font-size: 1rem !important;
    padding: 0 4px !important;
  }

  .tp-keypad-tabs .tp-chip {
    font-size: 0.74rem;
    padding: 5px 8px;
  }

  .tp-quick-phrases-bar .tp-chip {
    font-size: 0.74rem;
    padding: 4px 8px;
  }
}

/* Compact Smartphone Screens (<= 360px) */
@media (max-width: 360px) {
  .tp-nd-style-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .tp-nd-style-grid .tp-btn {
    width: 100% !important;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }

  .tp-nd-date-row {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
}

/* ==========================================================================
   UNIVERSAL UNIT & MEASUREMENT CONVERTER
   ========================================================================== */

.tp-conv-cat-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tp-conv-cat-bar::-webkit-scrollbar {
  display: none;
}

.tp-universal-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.tp-universal-swap-col {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 4px;
}

.tp-swap-circle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  color: var(--brand-green);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  padding: 0;
}

.tp-swap-circle-btn svg {
  margin: 0 !important;
  width: 18px;
  height: 18px;
}

.tp-swap-circle-btn:hover {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #ffffff;
  transform: rotate(180deg);
}

.tp-swap-circle-btn:active {
  transform: scale(0.92) rotate(180deg);
}

.tp-conv-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.tp-conv-unit-card {
  background: var(--bg-surface-alt, var(--bg-input));
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-conv-unit-card:hover {
  border-color: var(--brand-green);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.tp-conv-unit-card.active {
  border-color: var(--brand-green);
  background: var(--brand-green-lite);
}

[data-theme="dark"] .tp-conv-unit-card.active {
  background: rgba(26, 106, 88, 0.2);
}

@media (max-width: 768px) {
  .tp-universal-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tp-universal-swap-col {
    margin: -4px 0;
  }

  .tp-swap-circle-btn {
    transform: rotate(90deg);
  }

  .tp-swap-circle-btn:hover {
    transform: rotate(270deg);
  }

  .tp-conv-matrix-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Passport Name & Date Photo Spec Pill UI */
.tp-passport-spec-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--brand-green-lite, rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-green, #10b981);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
  transition: all 0.3s ease;
}

.tp-passport-spec-pill:hover {
  border-color: var(--brand-green, #10b981);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.tp-passport-spec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-green, #10b981);
  box-shadow: 0 0 8px var(--brand-green, #10b981);
  animation: tp-spec-pulse 2s infinite ease-in-out;
}

@keyframes tp-spec-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* ========================================================
   FOCUS & STUDY TIMER (POMODORO, AMBIENT SOUND, ZEN MODE)
   ======================================================== */
/* Focus & Study Timer Visual Suite */
.tp-timer-zen-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.tp-timer-zen-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.tp-timer-zen-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 10px var(--brand-green);
  animation: tp-pulse-dot 1.8s infinite ease-in-out;
}

@keyframes tp-pulse-dot {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.tp-timer-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tp-timer-tab {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.tp-timer-tab:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
  transform: translateY(-1px);
}

.tp-timer-tab.active {
  background: linear-gradient(135deg, var(--brand-green), #059669);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.tp-timer-card {
  position: relative;
  padding: 32px 24px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.tp-timer-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #38bdf8, #c084fc);
  opacity: 0.8;
}

.tp-timer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.tp-timer-task-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--bg-surface-alt, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--border-light);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-timer-task-pill:hover {
  background: var(--brand-green-lite);
  border-color: var(--brand-green);
}

.tp-timer-task-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  background: var(--brand-green);
  color: #ffffff;
  border-radius: 4px;
}

.tp-timer-task-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.tp-timer-task-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tp-timer-ring-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 10px auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
}

.tp-timer-ring-backdrop {
  position: absolute;
  width: 236px;
  height: 236px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bg-surface-alt, rgba(0, 0, 0, 0.02)) 0%, transparent 70%);
  pointer-events: none;
}

.tp-timer-ring-svg {
  width: 280px;
  height: 280px;
  transform: rotate(-90deg);
  overflow: visible;
}

.tp-timer-track {
  stroke: var(--border-light, #e2e8f0);
  opacity: 0.6;
}

[data-theme="dark"] .tp-timer-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.tp-timer-progress {
  stroke: url(#tp-timer-grad-focus);
  stroke-dasharray: 791.68;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.85s linear, stroke 0.4s ease;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.35));
}

.tp-timer-display-inner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}

.tp-timer-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.tp-timer-digits {
  font-size: 3.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.tp-timer-ring-container.running .tp-timer-digits {
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.tp-timer-subtext {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Pulsing & Glow States when running */
.tp-timer-ring-container.running {
  animation: tp-timer-pulse 3.5s infinite ease-in-out;
}

.tp-timer-ring-container.running.break-mode {
  animation: tp-timer-break-pulse 3.5s infinite ease-in-out;
}

.tp-timer-ring-container.completed {
  animation: tp-timer-celebrate 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tp-timer-pulse {

  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.22));
    transform: scale(1);
  }

  50% {
    filter: drop-shadow(0 0 28px rgba(16, 185, 129, 0.5));
    transform: scale(1.018);
  }
}

@keyframes tp-timer-break-pulse {

  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.22));
    transform: scale(1);
  }

  50% {
    filter: drop-shadow(0 0 28px rgba(56, 189, 248, 0.52));
    transform: scale(1.018);
  }
}

@keyframes tp-timer-celebrate {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.07);
    filter: drop-shadow(0 0 35px rgba(16, 185, 129, 0.85));
  }

  100% {
    transform: scale(1);
  }
}

/* Controls Deck */
.tp-timer-controls-deck {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 20px;
}

.tp-timer-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-green, #10b981), #059669);
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.tp-timer-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.6);
}

.tp-timer-play-btn:active {
  transform: scale(0.94);
}

.tp-timer-ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface-alt, #f1f5f9);
  border: 1px solid var(--border-light, #e2e8f0);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-timer-ctrl-btn:hover {
  background: var(--bg-card);
  border-color: var(--brand-green);
  color: var(--brand-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.tp-timer-ctrl-btn:active {
  transform: translateY(0);
}

/* Quick Time Adjustment Chips */
.tp-timer-adjust-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.tp-timer-chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border-light);
  background: var(--bg-surface-alt, rgba(0, 0, 0, 0.03));
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-timer-chip:hover {
  background: var(--brand-green-lite);
  border-color: var(--brand-green);
  color: var(--brand-green);
  transform: translateY(-1px);
}

/* Lower Two-Column Grid */
.tp-timer-lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.tp-timer-subcard {
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.tp-timer-subcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tp-timer-subcard-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tp-badge-soft {
  background: var(--bg-surface-alt);
  color: var(--text-muted);
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
}

.tp-badge-success {
  background: var(--brand-green-lite);
  color: var(--brand-green);
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.tp-timer-subcard-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.45;
}

/* Presets List */
.tp-presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-preset-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-surface-alt, rgba(0, 0, 0, 0.02));
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.tp-preset-item:hover {
  border-color: var(--brand-green);
  background: var(--brand-green-lite);
  transform: translateX(2px);
}

.tp-preset-item.active {
  border-color: var(--brand-green);
  background: var(--brand-green-lite);
  box-shadow: inset 3px 0 0 var(--brand-green);
}

.tp-preset-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tp-preset-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Custom Box */
.tp-timer-custom-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.tp-timer-custom-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.tp-timer-custom-row {
  display: flex;
  gap: 10px;
}

.tp-timer-custom-row input {
  flex: 1;
}

/* Ambient Audio Chips */
.tp-ambient-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tp-ambient-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-ambient-chip:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
}

.tp-ambient-chip.active {
  background: var(--brand-green-lite);
  border-color: var(--brand-green);
  color: var(--brand-green);
  font-weight: 700;
}

.tp-timer-vol-group {
  margin-bottom: 14px;
}

.tp-timer-vol-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.tp-timer-vol-val {
  font-weight: 700;
  color: var(--brand-green);
}

.tp-timer-chime-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.tp-timer-chime-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Daily Productivity Tracker */
.tp-timer-stats-card {
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.tp-timer-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.tp-timer-stats-title {
  margin: 0 0 2px;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tp-timer-stats-desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tp-timer-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.tp-timer-stat-box {
  background: var(--bg-surface-alt, var(--bg-input));
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.tp-timer-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
}

.tp-timer-stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--brand-green);
  display: block;
  margin-top: 4px;
}

.tp-timer-progress-bar-bg {
  height: 8px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.tp-timer-progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green), #059669);
  transition: width 0.4s ease;
  border-radius: 999px;
}

/* Zen Distraction-Free Fullscreen Mode */
.tp-timer-zen-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background: var(--bg-body, #ffffff) !important;
  padding: 24px 20px !important;
  margin: 0 !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.tp-timer-zen-mode .tp-timer-card {
  max-width: 620px;
  width: 100%;
  margin-top: auto;
  margin-bottom: auto;
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-green-lite);
}

.tp-timer-zen-mode .tp-timer-lower-grid,
.tp-timer-zen-mode>.tp-card:not(.tp-timer-card) {
  display: none !important;
}

/* Responsive Breakpoints & Mobile Optimization */
@media (max-width: 768px) {
  .tp-timer-card {
    padding: 24px 16px;
    border-radius: 16px;
  }

  .tp-timer-lower-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tp-timer-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .tp-timer-task-pill {
    width: 100%;
    justify-content: center;
  }

  .tp-timer-task-title {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tp-timer-zen-btn {
    width: 100%;
    justify-content: center;
  }

  .tp-timer-stats-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .tp-timer-card {
    padding: 20px 12px;
  }

  .tp-timer-tabs {
    gap: 6px;
  }

  .tp-timer-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  .tp-timer-ring-container {
    width: 230px;
    height: 230px;
    margin: 6px auto 18px;
  }

  .tp-timer-ring-backdrop {
    width: 190px;
    height: 190px;
  }

  .tp-timer-ring-svg {
    width: 230px;
    height: 230px;
  }

  .tp-timer-digits {
    font-size: 2.75rem;
  }

  .tp-timer-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    letter-spacing: 0.08em;
  }

  .tp-timer-subtext {
    font-size: 0.78rem;
  }

  .tp-timer-play-btn {
    width: 60px;
    height: 60px;
  }

  .tp-timer-ctrl-btn {
    width: 42px;
    height: 42px;
  }

  .tp-timer-controls-deck {
    gap: 14px;
  }

  .tp-timer-chip {
    padding: 4px 10px;
    font-size: 0.74rem;
  }

  .tp-timer-subcard {
    padding: 16px;
  }

  .tp-ambient-chip {
    padding: 5px 10px;
    font-size: 0.74rem;
  }

  .tp-timer-stats-card {
    padding: 16px;
  }

  .tp-timer-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tp-timer-stat-box {
    padding: 12px 14px;
  }

  .tp-timer-stat-value {
    font-size: 1.4rem;
  }
}

@media (max-width: 360px) {
  .tp-timer-ring-container {
    width: 195px;
    height: 195px;
  }

  .tp-timer-ring-backdrop {
    width: 160px;
    height: 160px;
  }

  .tp-timer-ring-svg {
    width: 195px;
    height: 195px;
  }

  .tp-timer-digits {
    font-size: 2.35rem;
  }

  .tp-timer-play-btn {
    width: 52px;
    height: 52px;
  }

  .tp-timer-ctrl-btn {
    width: 38px;
    height: 38px;
  }
}

/* ==========================================================================
   UNIVERSAL MOBILE RESPONSIVE PROTECTION LAYER
   Ensures all 53 tools are fully responsive down to 320px screen width
   ========================================================================== */

/* Universal Box Sizing & Fluid Containment */
#tp-workspace-view,
.tp-workspace-card,
.tp-tool-inner,
.tp-card,
.tp-form-group,
.tp-presets,
.tp-presets-bar,
.tp-chip-group,
.tp-btn-group,
.tp-crop-ratios,
.tp-editor-filter-chips,
.tp-editor-tabs,
.tp-keypad-tabs,
.tp-quick-phrases-bar,
.tp-wm-chip-group,
.tp-sig-chip-row,
.tp-passport-btn-group,
.tp-passport-quick-tools,
.tp-ai-preset-chips,
.tp-conv-cat-bar,
.tp-format-tabs,
.tp-table-wrap,
.tp-sip-table-wrap,
.tp-csv-table-wrap {
  max-width: 100%;
  box-sizing: border-box;
}

/* Ensure no element forces horizontal page breakout */
.tp-tool-inner * {
  box-sizing: border-box;
}

/* All inputs, selects, textareas, and canvases must be fluid */
.tp-tool-inner input,
.tp-tool-inner select,
.tp-tool-inner textarea,
.tp-tool-inner canvas,
.tp-tool-inner img,
.tp-tool-inner video {
  max-width: 100%;
  box-sizing: border-box;
}

/* All chips and preset buttons */
.tp-chip,
.tp-chip-btn,
.tp-btn,
.tp-presets button,
.tp-presets .tp-chip {
  max-width: 100%;
  box-sizing: border-box;
}

/* Universal Table Protection - never blowout card width */
.tp-workspace-card table {
  max-width: 100%;
  box-sizing: border-box;
}

.tp-table-wrap,
.tp-sip-table-wrap,
.tp-csv-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Calculator Grids & Image Resizer Preview */
.tp-calc-mem-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.tp-calc-keypad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

#resizer-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {

  /* Enforce flex-wrap on all preset rows, button groups, and tab bars */
  .tp-presets,
  .tp-presets-bar,
  .tp-chip-group,
  .tp-btn-group,
  .tp-crop-ratios,
  .tp-editor-filter-chips,
  .tp-quick-phrases-bar,
  .tp-wm-chip-group,
  .tp-sig-chip-row,
  .tp-passport-quick-tools,
  .tp-ai-preset-chips,
  .tp-conv-cat-bar,
  .tp-split-actions,
  .tp-conv-footer-actions,
  .tp-editor-actions,
  .tp-passport-actions,
  .tp-sip-actions,
  .tp-qr-presets {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* All form grids & two-col grids collapse to single column */
  .tp-form-grid,
  .tp-two-col-grid,
  .tp-three-col-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* YouTube Thumbnails & Lock Password */
  .tp-yt-thumb-grid,
  #yt-thumb-results div[style*="minmax(290px"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .tp-lock-pwd-grid,
  #pdf-lock-workspace div[style*="minmax(260px"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Editor cards multi-col collapse */
  .tp-editor-card div[style*="grid-template-columns"],
  .tp-editor-inner div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #sip-scenarios-box {
    grid-template-columns: 1fr !important;
  }
}

/* Smartphone Screens (<= 480px) */
@media (max-width: 480px) {
  #tp-workspace-view {
    padding: 12px 0 40px !important;
  }

  .tp-workspace-card {
    padding: 16px 12px !important;
  }

  .tp-card {
    padding: 14px 10px !important;
  }

  /* Prevent preset labels or chips from overflowing */
  .tp-presets .tp-chip,
  .tp-presets button,
  .tp-chip-group .tp-chip,
  .tp-nd-presets .tp-chip,
  .tp-editor-filter-chips .tp-chip,
  .tp-crop-ratios .tp-chip,
  .tp-keypad-tabs .tp-chip {
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.25 !important;
    text-align: center !important;
    font-size: 0.8rem !important;
  }

  /* Passport Photo Resizer input grids */
  #pass-name-date-inputs,
  .tp-passport-dropdown div[style*="grid-template-columns:1fr 1fr"],
  .tp-passport-dropdown div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .tp-passport-preset-card {
    padding: 12px !important;
  }

  .tp-passport-preset-header {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .tp-passport-btn-group {
    flex-wrap: wrap !important;
  }

  .tp-passport-btn-group .tp-btn {
    flex: 1 1 40% !important;
    min-height: 34px !important;
  }

  /* Image Resizer Exact Pixels Row */
  .tp-resizer-dim-grid {
    grid-template-columns: 1fr auto 1fr !important;
    gap: 6px !important;
    align-items: end !important;
  }

  #resizer-lock-btn {
    padding: 7px 8px !important;
    min-height: 38px !important;
  }

  /* PDF Editor and Presentation Slides grids */
  #pdf-edit-pages-grid,
  #ppt-slides-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 10px !important;
  }

  /* Name & Date Studio */
  .tp-nd-date-row {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  /* Four Col Grids -> 2 columns */
  .tp-four-col-grid,
  #gst-rate-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  /* Color Picker RGB/HSL grids */
  .tp-color-rgb-grid,
  .tp-color-hsl-grid,
  #color-main-grid div[style*="grid-template-columns:1fr 1fr 1fr"],
  #color-main-grid div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    gap: 6px !important;
  }

  /* GST Main Grid Highlights */
  #gst-main-grid div[style*="minmax(180px"] {
    grid-template-columns: 1fr !important;
  }

  /* Multi-option action buttons stack gracefully */
  .tp-btn-group {
    flex-direction: column !important;
    width: 100% !important;
  }

  .tp-btn-group .tp-btn {
    width: 100% !important;
  }

  /* Dropdown Summaries */
  .tp-dropdown-summary {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* Timer Workspace */
  #timer-workspace div[style*="minmax(180px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Compact Smartphone Screens (<= 360px) */
@media (max-width: 360px) {
  .tp-workspace-card {
    padding: 14px 8px !important;
  }

  .tp-card {
    padding: 12px 8px !important;
  }

  .tp-workspace-title-box h1 {
    font-size: 1.15rem !important;
  }

  /* Color picker palette and RGB on tiny screens */
  .tp-color-rgb-grid,
  .tp-color-hsl-grid,
  #color-main-grid div[style*="grid-template-columns:1fr 1fr 1fr"],
  #color-main-grid div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  #color-palette {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 4px !important;
  }

  /* Timer ring container on tiny screens */
  .tp-timer-ring-container,
  .tp-timer-ring-svg {
    width: 200px !important;
    height: 200px !important;
  }

  .tp-timer-digits {
    font-size: 2.3rem !important;
  }

  .tp-qr-wa-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  /* Four Col Grids -> single column on very small phones */
  .tp-four-col-grid,
  #gst-rate-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .tp-btn {
    font-size: 0.8rem !important;
    padding: 8px 10px !important;
  }
}

/* ==========================================================================
   SEO CONTENT & FAQ ACCORDION SECTION
   ========================================================================== */
.tp-seo-section {
  padding: 60px 0 30px;
  border-top: 1px solid var(--border-light);
}

.tp-seo-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 36px;
}

.tp-seo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  border-radius: var(--r-pill);
  margin-bottom: 12px;
}

.tp-seo-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.tp-seo-subtitle {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.tp-seo-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.tp-seo-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: transform var(--ease-normal), box-shadow var(--ease-normal), border-color var(--ease-normal);
}

.tp-seo-feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-green);
  box-shadow: var(--shadow-sm);
}

.tp-seo-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: var(--brand-green-lite);
  color: var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.tp-seo-feature-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.tp-seo-feature-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* FAQ Accordion */
.tp-faq-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

.tp-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--ease-normal);
}

.tp-faq-item[open] {
  border-color: var(--brand-green);
}

.tp-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color var(--ease-fast);
}

.tp-faq-question::-webkit-details-marker {
  display: none;
}

.tp-faq-question:hover {
  background: var(--bg-card-hover);
}

.tp-faq-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform var(--ease-normal), color var(--ease-normal);
}

.tp-faq-item[open] .tp-faq-chevron {
  transform: rotate(180deg);
  color: var(--brand-green);
}

.tp-faq-answer {
  padding: 0 20px 18px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
  border-top: 1px solid transparent;
}

@media (max-width: 768px) {
  .tp-seo-features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tp-seo-section {
    padding: 40px 0 20px;
  }

  .tp-seo-title {
    font-size: 1.45rem;
  }

  .tp-faq-question {
    font-size: 0.9rem;
    padding: 14px 16px;
  }

  .tp-faq-answer {
    padding: 0 16px 14px;
    font-size: 0.85rem;
  }

  .tp-btn-share span {
    display: none;
  }

  .tp-btn-share {
    padding: 0;
    width: 40px;
    height: 40px;
    justify-content: center;
  }
}

/* ==========================================================================
   UNIVERSAL UNIT CONVERTER CATEGORY TABS STYLING
   ========================================================================== */
.tp-conv-cat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  padding: 4px 0 16px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .tp-conv-cat-bar {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .tp-conv-cat-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tp-uconv-tab {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md, 12px);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.tp-uconv-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tp-uconv-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(26, 106, 88, 0.28);
}

.tp-uconv-tab .tp-uconv-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.tp-uconv-tab.active .tp-uconv-tab-icon {
  background: rgba(255, 255, 255, 0.22);
}

.tp-uconv-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--brand-green-lite, rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 9999px;
  color: var(--brand-green, #059669);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tp-pulse-green-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: tpPulseGreen 2s infinite;
  flex-shrink: 0;
}

@keyframes tpPulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ==========================================================================
   EXAM MARKS & SCORE CALCULATOR STYLES (.tp-exam-*)
   ========================================================================== */
.tp-exam-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.tp-exam-presets-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}

.tp-exam-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 0.84rem;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--ease-fast);
  user-select: none;
}

.tp-exam-chip:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
  background: var(--brand-green-lite);
}

.tp-exam-chip.active {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(26, 106, 88, 0.25);
}

.tp-custom-sec-row {
  transition: var(--ease-normal);
}

@media (max-width: 680px) {
  .tp-custom-sec-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
}

.tp-exam-dashboard-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--ease-normal);
  animation: tpExamDashReveal 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tpExamDashReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-exam-actions-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 24px 0 20px;
}

.tp-exam-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.tp-exam-score-title {
  font-family: var(--font-brand);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0 0;
  line-height: 1.2;
}

.tp-exam-rating-badge {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}

.tp-exam-progress-wrap {
  height: 10px;
  background: var(--bg-input);
  border-radius: var(--r-pill);
  overflow: hidden;
  display: flex;
  margin-bottom: 20px;
}

.tp-exam-progress-pos {
  background: #10b981;
  transition: width 0.3s ease;
}

.tp-exam-progress-neg {
  background: #ef4444;
  transition: width 0.3s ease;
}

.tp-exam-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  text-align: center;
}

.tp-exam-stat-card {
  background: var(--bg-surface-alt);
  padding: 12px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tp-exam-stat-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tp-exam-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-sans);
}

.tp-exam-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.tp-exam-mode-toggle-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 3px;
}

.tp-exam-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 0.84rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--ease-fast);
}

.tp-exam-mode-btn:hover {
  color: var(--text-primary);
}

.tp-exam-mode-btn.active {
  background: var(--brand-green);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(26, 106, 88, 0.28);
}

.tp-exam-section-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--ease-fast);
}

.tp-exam-section-card:hover {
  border-color: var(--border-mid);
}

.tp-exam-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 12px;
}

.tp-exam-counter-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tp-exam-counter-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: var(--r-sm);
}

.tp-exam-counter-input {
  width: 60px;
  text-align: center;
  font-weight: 800;
  height: 36px;
  padding: 0 4px;
}

.tp-exam-omr-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tp-exam-omr-bubble {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
}

.tp-exam-omr-bubble.unattempted {
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-light);
}

.tp-exam-omr-bubble.unattempted:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
}

.tp-exam-omr-bubble.correct {
  background: #10b981;
  color: #ffffff;
  border: 1.5px solid #10b981;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.tp-exam-omr-bubble.wrong {
  background: #ef4444;
  color: #ffffff;
  border: 1.5px solid #ef4444;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

@media (max-width: 640px) {
  .tp-exam-dashboard-header {
    flex-direction: column;
  }

  .tp-exam-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tp-exam-counter-box {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================
   AI RESUME MAKER & CV BUILDER
   ========================================== */
.tp-resume-builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.tp-resume-builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .tp-resume-builder-layout {
    grid-template-columns: 1fr;
  }

  .tp-resume-preview-wrapper {
    position: static;
  }
}

.tp-resume-editor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.tp-resume-preview-wrapper {
  position: sticky;
  top: 80px;
}

.tp-resume-paper-container {
  background: var(--bg-surface-alt, #f8fafc);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: auto;
}

.tp-resume-paper {
  width: 100%;
  max-width: 680px;
  min-height: 860px;
  background: #ffffff;
  color: #1e293b;
  padding: 36px 40px;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  font-family: 'Times New Roman', Times, Georgia, serif;
  line-height: 1.5;
  transition: all 0.25s ease;
}

.tp-resume-paper * {
  font-family: 'Times New Roman', Times, Georgia, serif;
}

.tp-resume-header-block {
  border-bottom: 2px solid var(--resume-accent, #2563eb);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.tp-resume-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.tp-resume-title-sub {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--resume-accent, #2563eb);
  margin-bottom: 12px;
}

.tp-resume-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 0.82rem;
  color: #475569;
  font-weight: 500;
}

.tp-resume-contact-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tp-resume-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--resume-accent, #2563eb);
  border-bottom: 1.5px solid var(--resume-accent-light, #e2e8f0);
  padding-bottom: 4px;
  margin: 18px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tp-resume-text-para {
  font-size: 0.88rem;
  color: #334155;
  margin-bottom: 12px;
  line-height: 1.55;
}

.tp-resume-exp-item {
  margin-bottom: 14px;
}

.tp-resume-exp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.tp-resume-exp-role {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
}

.tp-resume-exp-company {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--resume-accent, #2563eb);
}

.tp-resume-exp-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.tp-resume-bullets {
  margin: 6px 0 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: #334155;
}

.tp-resume-bullets li {
  margin-bottom: 4px;
}

.tp-resume-skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tp-resume-skill-chip {
  background: var(--resume-chip-bg, #f1f5f9);
  color: var(--resume-chip-text, #1e293b);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.tp-resume-edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.tp-resume-accordion {
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card);
}

.tp-resume-accordion-header {
  padding: 14px 18px;
  background: var(--bg-surface-alt);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  user-select: none;
}

.tp-resume-accordion-body {
  padding: 18px;
}

/* Template Layout Styles */

/* 1. Classic Standard (ATS Single Column) */
.tp-resume-paper.tp-resume-style-classic {
  font-family: 'Times New Roman', Times, Georgia, serif;
}

/* 2. Modern Executive (2-Column Left Sidebar) */
.tp-resume-paper.tp-resume-style-modern {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 24px;
  padding: 0;
  overflow: hidden;
}

.tp-resume-style-modern .tp-resume-modern-left {
  background: var(--bg-surface-alt, #f8fafc);
  border-right: 1.5px solid var(--border-light, #e2e8f0);
  padding: 30px 20px;
}

.tp-resume-style-modern .tp-resume-modern-right {
  padding: 30px 24px 30px 0;
}

@media (max-width: 640px) {
  .tp-resume-paper.tp-resume-style-modern {
    grid-template-columns: 1fr !important;
  }

  .tp-resume-style-modern .tp-resume-modern-right {
    padding: 16px;
  }
}

/* 3. Government Official (Formal Banners Layout) */
.tp-resume-paper.tp-resume-style-official {
  border: 2px solid #334155;
  padding: 30px 36px;
}

.tp-resume-style-official .tp-resume-header-block {
  border-bottom: 3px double var(--resume-accent, #2563eb);
  text-align: center;
}

.tp-resume-style-official .tp-resume-contact-row {
  justify-content: center;
}

.tp-resume-style-official .tp-resume-section-title {
  background: var(--bg-surface-alt, #f1f5f9);
  border-left: 5px solid var(--resume-accent, #2563eb);
  border-bottom: none;
  padding: 6px 12px;
  border-radius: 0 4px 4px 0;
  color: var(--resume-accent, #2563eb);
}

/* 4. Minimalist Serif Layout */
.tp-resume-paper.tp-resume-style-minimal {
  padding: 40px 48px;
}

.tp-resume-style-minimal .tp-resume-header-block {
  border-bottom: 1px solid #e2e8f0;
}

.tp-resume-style-minimal .tp-resume-section-title {
  border-bottom: 1px solid #e2e8f0;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: #1e293b;
}

/* Mobile Responsiveness Rules */
@media (max-width: 640px) {
  .tp-resume-editor-card {
    padding: 14px;
    border-radius: var(--r-lg);
  }

  .tp-resume-accordion-header {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .tp-resume-accordion-body {
    padding: 14px 10px;
  }

  .tp-resume-paper-container {
    padding: 10px;
    border-radius: var(--r-lg);
  }

  .tp-resume-paper {
    padding: 20px 16px;
    min-height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  }

  .tp-resume-name {
    font-size: 1.35rem;
  }

  .tp-resume-title-sub {
    font-size: 0.92rem;
  }

  .tp-resume-contact-row {
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
  }

  .tp-resume-section-title {
    font-size: 0.88rem;
    margin: 14px 0 8px 0;
  }

  .tp-resume-text-para {
    font-size: 0.82rem;
  }

  .tp-resume-exp-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .tp-resume-bullets {
    padding-left: 14px;
    font-size: 0.8rem;
  }

  /* Force 1-column layout for input grids on mobile */
  .tp-resume-editor-card .tp-form-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Modal Backdrop & Overlay System */
.tp-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tp-modal.open {
  display: flex !important;
  opacity: 1 !important;
}

.tp-modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-modal.open .tp-modal-card {
  transform: scale(1);
}

.tp-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-surface-alt, #f1f5f9);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.tp-modal-close:hover {
  background: var(--border-mid);
  color: var(--text-primary);
}

/* SEO Section & FAQ Typography — Editorial Design System */
.tp-seo-section {
  padding: 64px 0;
  background: var(--bg-page);
  border-top: 1px solid var(--border-light);
}

.tp-seo-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 40px;
}

.tp-seo-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-green);
  background: var(--brand-green-lite);
  border: 1px solid rgba(26, 106, 88, 0.25);
  padding: 4px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 16px;
}

.tp-seo-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.tp-seo-subtitle {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tp-seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 56px;
}

.tp-seo-feature-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  transition: all var(--ease-fast);
}

.tp-seo-feature-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.tp-seo-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-green-lite);
  color: var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.tp-seo-feature-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.tp-seo-feature-desc {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tp-faq-wrapper {
  max-width: 820px;
  margin: 0 auto;
}

.tp-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-faq-item {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--ease-fast);
}

.tp-faq-item[open] {
  border-color: var(--border-mid);
}

.tp-faq-question {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 18px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.tp-faq-question::-webkit-details-marker {
  display: none;
}

.tp-faq-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.tp-faq-item[open] .tp-faq-chevron {
  transform: rotate(180deg);
  color: var(--brand-green);
}

.tp-faq-answer {
  font-family: var(--font-sans);
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 0 24px 20px;
}

/* Download Ad Modal & Interstitial Timer */
.tp-download-ad-card {
  max-width: 500px !important;
  width: calc(100% - 32px) !important;
  box-sizing: border-box !important;
  padding: 24px !important;
  border-radius: var(--r-xl) !important;
  background: var(--bg-surface) !important;
  box-shadow: var(--shadow-lg) !important;
  position: relative;
  overflow: hidden !important;
}

.tp-dl-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tp-dl-spinner-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand-green-lite);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(26, 106, 88, 0.2);
  border-top-color: var(--brand-green, #1a6a58);
  border-radius: 50%;
  animation: tp-spin 0.8s linear infinite;
  box-sizing: border-box;
}

@keyframes tp-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.tp-dl-modal-header-text,
.tp-dl-modal-header>div:not(.tp-dl-spinner-wrap) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tp-dl-modal-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tp-dl-modal-sub {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tp-dl-modal-sub strong {
  color: var(--brand-green);
  font-size: 0.95rem;
}

.tp-dl-ad-container {
  margin: 14px 0;
  min-height: 220px;
  background: var(--bg-surface-alt, #f8fafc);
  border: 1px dashed var(--border-mid);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.tp-dl-ad-placeholder {
  width: 100%;
  text-align: center;
}

.tp-dl-ad-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  padding: 6px 0 2px 0;
}

.tp-dl-ad-box-inner {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tp-dl-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.tp-dl-status-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile Responsiveness & Touch UI Enhancements */
@media (max-width: 640px) {
  .sc-keypad-grid {
    gap: 6px !important;
  }

  .tp-calc-btn {
    height: 42px !important;
    font-size: 0.95rem !important;
    border-radius: var(--r-sm) !important;
  }

  .tp-calc-btn-sc-func {
    font-size: 0.78rem !important;
    padding: 2px !important;
  }

  .tp-calc-btn-op {
    font-size: 1.1rem !important;
  }

  #sc-main-display {
    font-size: 1.85rem !important;
  }

  #sc-expr-display {
    font-size: 0.85rem !important;
  }
}

@media (max-width: 480px) {
  .sc-keypad-grid {
    gap: 4px !important;
  }

  .tp-calc-btn {
    height: 38px !important;
    font-size: 0.85rem !important;
  }

  .tp-calc-btn-sc-func {
    font-size: 0.7rem !important;
  }

  .tp-calc-btn-equal {
    font-size: 1.15rem !important;
  }

  #sc-main-display {
    font-size: 1.5rem !important;
  }

  .tp-tool-inner {
    padding: 12px 8px !important;
  }
}

/* ==========================================================================
   VIDEO RECORDER RESPONSIVE STYLES
   ========================================================================== */

.tp-rec-mode-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--bg-surface-alt, #f9f8f4);
  padding: 10px 16px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
}

.tp-rec-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Standard Tool Editorial & SEO Guide System */
.tp-tool-guide-wrap {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tp-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl, 24px);
  padding: 28px;
  box-shadow: var(--shadow-xs);
  text-align: left;
}

.tp-guide-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-guide-subhead {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 20px 0;
}

.tp-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.tp-step-card {
  background: var(--bg-surface-alt, #f9f8f4);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg, 16px);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--ease-fast), border-color var(--ease-fast);
}

.tp-step-card:hover {
  border-color: var(--brand-green);
  transform: translateY(-2px);
}

.tp-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-green);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tp-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.tp-step-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.tp-faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tp-faq-item {
  background: var(--bg-surface-alt, #f9f8f4);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md, 12px);
  overflow: hidden;
  transition: border-color var(--ease-fast), background-color var(--ease-fast), box-shadow var(--ease-fast);
}

.tp-faq-item[open] {
  border-color: var(--brand-green);
  background-color: var(--bg-surface, #ffffff);
  box-shadow: var(--shadow-xs);
}

.tp-faq-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 12px;
}

.tp-faq-summary::-webkit-details-marker,
.tp-faq-summary::marker {
  display: none;
  content: "";
}

.tp-faq-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--brand-green);
}

.tp-faq-item[open] .tp-faq-icon {
  transform: rotate(180deg);
}

.tp-faq-body {
  padding: 0 20px 18px 20px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid rgba(17, 17, 17, 0.06);
  padding-top: 14px;
}

.tp-faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tp-faq-card {
  background: var(--bg-surface-alt, #f9f8f4);
  border: 1px solid var(--border-light);
  border-left: 3.5px solid var(--brand-green);
  border-radius: var(--r-md, 12px);
  padding: 16px 18px;
}

.tp-faq-q {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.tp-faq-a {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 768px) {
  .tp-st-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .tp-st-toolbar>div {
    justify-content: space-between !important;
    width: 100% !important;
  }

  .tp-st-faq-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .tp-rec-mode-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 12px !important;
  }

  .tp-rec-mode-bar>div {
    width: 100% !important;
  }

  .tp-rec-settings-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
  }
}

@media (max-width: 640px) {
  .tp-st-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .tp-st-card {
    padding: 10px 4px !important;
  }

  .tp-st-card-title {
    font-size: 0.65rem !important;
    letter-spacing: 0.2px !important;
  }

  .tp-st-card-title svg {
    width: 11px !important;
    height: 11px !important;
  }

  .tp-st-metric-value {
    font-size: 1.18rem !important;
    margin: 2px 0 !important;
  }

  .tp-st-metric-sub {
    font-size: 0.62rem !important;
    line-height: 1.25 !important;
  }

  #st-gauge-number {
    font-size: 2.2rem !important;
  }

  .tp-st-telemetry-strip {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .tp-rec-mode-bar {
    padding: 10px !important;
    gap: 10px !important;
  }

  .tp-segmented-control {
    width: 100% !important;
    display: flex !important;
  }

  .tp-rec-mode-btn {
    flex: 1 !important;
    padding: 6px 8px !important;
    font-size: 0.75rem !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .tp-rec-mode-btn svg {
    margin-right: 2px !important;
    width: 12px !important;
    height: 12px !important;
  }

  .tp-select-sm,
  .tp-rec-select {
    min-width: 90px !important;
    font-size: 0.78rem !important;
    padding: 5px 24px 5px 10px !important;
    min-height: 34px !important;
    height: 34px !important;
    line-height: 1.2 !important;
  }

  #rec-preview-container {
    min-height: 230px !important;
    border-radius: var(--r-sm) !important;
  }

  .tp-rec-prompt-wrap {
    padding: 14px 10px !important;
  }

  .tp-rec-prompt-icon {
    width: 38px !important;
    height: 38px !important;
    margin-bottom: 6px !important;
  }

  .tp-rec-prompt-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .tp-rec-prompt-title {
    font-size: 1.05rem !important;
    margin-bottom: 4px !important;
  }

  .tp-rec-prompt-desc {
    font-size: 0.76rem !important;
    margin-bottom: 12px !important;
    line-height: 1.35 !important;
    max-width: 290px !important;
  }

  .tp-rec-prompt-btn {
    padding: 8px 18px !important;
    font-size: 0.8rem !important;
  }

  .tp-faq-summary {
    padding: 12px 14px !important;
    font-size: 0.88rem !important;
  }

  .tp-faq-body {
    padding: 0 14px 14px 14px !important;
    font-size: 0.81rem !important;
    padding-top: 10px !important;
  }

  #rec-live-badge-wrap {
    top: 8px !important;
    left: 8px !important;
    padding: 4px 10px !important;
  }

  #rec-quick-controls {
    top: 8px !important;
    right: 8px !important;
  }
}

@media (max-width: 380px) {
  .tp-st-metric-grid {
    gap: 6px !important;
  }

  .tp-st-card {
    padding: 8px 2px !important;
  }

  .tp-st-card-title {
    font-size: 0.58rem !important;
  }

  .tp-st-metric-value {
    font-size: 1.05rem !important;
  }

  .tp-st-metric-sub {
    font-size: 0.58rem !important;
  }

  .tp-rec-mode-btn {
    font-size: 0.7rem !important;
    padding: 5px 4px !important;
  }

  #rec-preview-container {
    min-height: 210px !important;
  }

  .tp-rec-prompt-wrap {
    padding: 10px 6px !important;
  }

  .tp-rec-prompt-icon {
    width: 32px !important;
    height: 32px !important;
    margin-bottom: 4px !important;
  }

  .tp-rec-prompt-icon svg {
    width: 15px !important;
    height: 15px !important;
  }

  .tp-rec-prompt-title {
    font-size: 0.92rem !important;
    margin-bottom: 2px !important;
  }

  .tp-rec-prompt-desc {
    font-size: 0.7rem !important;
    margin-bottom: 8px !important;
    max-width: 260px !important;
  }

  .tp-rec-prompt-btn {
    padding: 6px 12px !important;
    font-size: 0.72rem !important;
  }
}

/* Resume Print Styles */
@media print {
  body.tp-printing-resume * {
    visibility: hidden !important;
  }

  body.tp-printing-resume #tp-resume-paper,
  body.tp-printing-resume #tp-resume-paper * {
    visibility: visible !important;
  }

  body.tp-printing-resume #tp-resume-paper {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    padding: 20mm !important;
    margin: 0 !important;
    font-family: 'Times New Roman', Times, Georgia, serif !important;
  }
}

/* ==========================================================================
   FLOATING DAILY HUB BUBBLE & PAGE TRANSITION LOADER
   ========================================================================== */
.tp-daily-floating-bubble {
  position: fixed !important;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-mid, #0f4639) 100%);
  color: #ffffff !important;
  border-radius: 50%;
  box-shadow: 0 8px 28px rgba(26, 106, 88, 0.45), 0 0 0 2px rgba(255, 255, 255, 0.25);
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  animation: bubbleFloat 3s ease-in-out infinite alternate;
}

.tp-daily-floating-bubble:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 36px rgba(26, 106, 88, 0.55), 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.tp-daily-floating-bubble.is-hidden,
body.tp-tool-active .tp-daily-floating-bubble,
body.tp-ai-body-active .tp-daily-floating-bubble {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.tp-daily-bubble-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tp-daily-bubble-pulse-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #ffffff;
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes bubbleFloat {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-4px);
  }
}

@keyframes pulseDot {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.35);
    opacity: 0.6;
  }
}

@media (max-width: 600px) {
  .tp-daily-floating-bubble {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
  }
}

/* ==========================================================================
   IMAGE COMPRESSOR PILL TOGGLE & SCROLLABLE PRESETS
   ========================================================================== */
.tp-pill-segmented-control {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface-alt, #f1f5f9);
  padding: 4px;
  border-radius: 9999px;
  border: 1px solid var(--border-light, #e2e8f0);
  gap: 4px;
  max-width: 100%;
}

.tp-pill-toggle {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 6px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-pill-toggle:hover {
  color: var(--text-primary, #0f172a);
}

.tp-pill-toggle.active {
  background: var(--brand-green, #10b981);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .tp-pill-segmented-control {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .tp-pill-toggle {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .tp-pill-toggle.active {
  background: var(--brand-green, #10b981);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

/* Horizontally Scrollable Presets on Mobile & Desktop */
.tp-presets-scrollable {
  display: flex;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  gap: 8px !important;
  padding-bottom: 6px;
  align-items: center;
  scrollbar-width: thin;
  width: 100%;
  box-sizing: border-box;
}

.tp-presets-scrollable::-webkit-scrollbar {
  height: 4px;
}

.tp-presets-scrollable::-webkit-scrollbar-thumb {
  background: var(--border-mid, #cbd5e1);
  border-radius: 4px;
}

.tp-presets-scrollable .tp-chip {
  flex-shrink: 0 !important;
  width: auto !important;
  white-space: nowrap !important;
  text-align: center;
}

.tp-presets-scrollable-label {
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-right: 4px;
  white-space: nowrap;
  color: var(--text-primary);
}

/* ==========================================================================
   PRINT MEDIA STYLES (SIP CALCULATOR & GENERAL REPORT PRINTING)
   ========================================================================== */
@media print {

  /* Hide site chrome, topbar, navbar, modals, footers, and floating buttons */
  .tp-topbar,
  .tp-navbar,
  .tp-footer,
  .tp-daily-floating-bubble,
  .tp-dh-topbar,
  .tp-modal,
  .tp-sip-nav,
  .tp-sip-actions,
  .tp-presets-bar,
  .tp-dh-swipe-nav,
  .tp-dh-intro-overlay {
    display: none !important;
  }

  /* Unclip containers for multi-page print */
  html,
  body,
  #tp-workspace-view,
  .tp-workspace-card,
  .tp-tool-inner,
  .tp-sip-wrap,
  .tp-sip-table-wrap {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    position: static !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .tp-sip-table-wrap {
    overflow: visible !important;
  }

  .tp-sip-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10pt !important;
  }

  .tp-sip-table th {
    background: #1a6a58 !important;
    color: #ffffff !important;
    border: 1px solid #1a6a58 !important;
    padding: 6px 8px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .tp-sip-table td {
    border: 1px solid #e2e8f0 !important;
    padding: 6px 8px !important;
    color: #334155 !important;
    background: #ffffff !important;
  }

  .tp-sip-table tr {
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   TOOL DYNAMIC LOADER — Branded Loading Component
   ========================================================================== */
.tp-tool-loader-card {
  max-width: 480px;
  width: 100%;
  margin: 48px auto;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-sizing: border-box;
  animation: tp-fade-in 0.3s ease;
}

.tp-tool-loader-icon-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.tp-tool-loader-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(26, 106, 88, 0.15);
  border-top-color: var(--brand-green);
  border-right-color: var(--brand-green-mid, #2e8b73);
  animation: tp-spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

[data-theme="dark"] .tp-tool-loader-ring {
  border-color: rgba(52, 211, 153, 0.15);
  border-top-color: var(--brand-green);
  border-right-color: #34d399;
}

.tp-tool-loader-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
  background: var(--bg-surface);
  padding: 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  animation: tp-pulse-scale 2s ease-in-out infinite alternate;
}

@keyframes tp-pulse-scale {
  0% {
    transform: scale(0.96);
  }

  100% {
    transform: scale(1.04);
  }
}

.tp-tool-loader-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}

.tp-tool-loader-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

.tp-tool-loader-bar {
  width: 160px;
  height: 4px;
  background: var(--border-light);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
  margin-top: 4px;
}

.tp-tool-loader-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, var(--brand-green), transparent);
  border-radius: var(--r-pill);
  animation: tp-loader-shimmer 1.4s ease-in-out infinite;
}

@keyframes tp-loader-shimmer {
  0% {
    left: -45%;
  }

  100% {
    left: 100%;
  }
}

@media (max-width: 640px) {
  .tp-tool-loader-card {
    margin: 28px 12px;
    padding: 32px 18px;
  }
}

/* ==========================================================================
   INTERNET SPEED TEST TOOL — Mobile Responsive Styling
   ========================================================================== */
.tp-speedtest-wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding-bottom: 32px;
  box-sizing: border-box;
}

.tp-st-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--bg-surface-alt, #f9f8f4);
  padding: 10px 16px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid var(--border-light, rgba(17, 17, 17, 0.1));
  width: 100%;
  box-sizing: border-box;
}

.tp-st-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.tp-st-telemetry-card {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.tp-st-telemetry-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-st-telemetry-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
}

.tp-st-telemetry-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-st-telemetry-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  width: 100%;
}

.tp-st-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.tp-st-card {
  padding: 16px 10px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  min-width: 0;
  box-sizing: border-box;
}

.tp-st-card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tp-st-metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.15;
}

.tp-st-metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .tp-st-telemetry-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tp-st-metric-grid {
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .tp-st-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .tp-st-toolbar>div {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .tp-st-metric-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tp-st-card {
    padding: 14px 12px;
  }

  .tp-st-telemetry-card {
    padding: 10px 12px;
  }

  .tp-st-telemetry-val {
    font-size: 0.84rem;
  }
}

/* ============================================================
   ENHANCED IMAGE RESIZER STUDIO - MOBILE RESPONSIVE ENGINE
   ============================================================ */

@media (max-width: 900px) {
  #resizer-main-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

@media (max-width: 640px) {
  #resizer-workspace {
    margin-top: 12px !important;
  }

  #resizer-main-grid>.tp-card {
    padding: 14px 12px !important;
    border-radius: 10px !important;
  }

  #resizer-side-view {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #resizer-orig-preview-img,
  #resizer-new-preview-img {
    max-height: 210px !important;
  }

  #resizer-side-view>.tp-card>div[style*="height:260px"],
  #resizer-side-view>.tp-card>div[style*="height: 260px"] {
    height: 210px !important;
  }

  #resizer-split-container {
    height: 250px !important;
  }

  .tp-resizer-dim-grid {
    grid-template-columns: 1fr auto 1fr !important;
    gap: 6px !important;
    align-items: end !important;
  }

  .tp-resizer-dim-grid .tp-input {
    font-size: 0.9rem !important;
    padding: 8px 6px !important;
  }

  #resizer-lock-btn {
    padding: 7px 8px !important;
    min-height: 38px !important;
    width: auto !important;
  }

  /* Unit switcher on narrow mobile */
  #resizer-workspace .tp-pill-segmented-control {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 3px !important;
    gap: 3px !important;
  }

  #resizer-workspace .tp-pill-segmented-control::-webkit-scrollbar {
    display: none !important;
  }

  #resizer-workspace .tp-pill-toggle {
    flex: 1 0 auto !important;
    white-space: nowrap !important;
    padding: 6px 10px !important;
    font-size: 0.76rem !important;
  }

  /* Format and Quality Controls Stack */
  #resizer-workspace div[style*="grid-template-columns:1fr 1fr"],
  #resizer-workspace div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Fit Mode Buttons Stack */
  #resizer-workspace div[style*="grid-template-columns:1fr 1fr 1fr"],
  #resizer-workspace div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }

  #resizer-workspace div[style*="grid-template-columns:1fr 1fr 1fr"] .tp-btn,
  #resizer-workspace div[style*="grid-template-columns: 1fr 1fr 1fr"] .tp-btn {
    font-size: 0.72rem !important;
    padding: 6px 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Main Action Buttons on Mobile */
  #resizer-dl-single-btn,
  #resizer-dl-all-btn {
    font-size: 0.92rem !important;
    padding: 12px 14px !important;
    min-height: 46px !important;
  }

  /* Quick Aspect Ratio Chips */
  #resizer-dim-inputs div[style*="display:flex; gap:5px"] {
    gap: 4px !important;
  }

  #resizer-dim-inputs .tp-chip {
    padding: 3px 7px !important;
    font-size: 0.72rem !important;
  }
}

/* ==========================================================================
   Google AdSense Responsive Unit Styling
   ========================================================================== */
.tp-ad-banner-wrap {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
}

.tp-ad-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* Google AdSense: Hide Unfilled Ad Slots Automatically */
ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}