:root {
    --ic-accent: #10b981;
    --ic-accent-dark: #0d9668;
    --ic-navy: #1e2a4a;
    --ic-border: #d1d5db;
  }
  * { box-sizing: border-box; }
  body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f3f4f6;
    margin: 0;
    padding: 24px 15px 60px;
    color: #1f2937;
  }
  .ic-wrap { max-width: 920px; margin: 0 auto; }

  /* ==== PAGE HEADER (white bar, logo + centered nav) ==== */
  .ic-page-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: relative;
    background: #fff;
    border-bottom: 1px solid var(--ic-border);
    padding: 22px 24px;
    margin: -24px -15px 24px;
  }
  .ic-page-logo {
    grid-column: 1;
    justify-self: start;
    display: flex;
    align-items: center;
    text-decoration: none;
    min-width: 0;
  }
  .ic-logo-svg {
    height: 36px;
    width: auto;
    display: block;
  }
  .ic-page-home-link {
    font-size: 17px;
    font-weight: 600;
    color: var(--ic-navy);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .ic-page-home-link:hover { background: #f3f4f6; }

  @media (max-width: 640px) {
    .ic-page-header {
        padding: 12px 16px;
        margin: -24px -15px 20px;
        grid-template-columns: auto auto;
        justify-content: space-between;
    }

    .ic-logo-svg {
        height: 28px;
    }
  }

  /* ==== COMPRESSOR TOOLS DROPDOWN NAV ====
     Uses grid placement (column 2 of the header's 3-column grid) instead
     of absolute positioning — grid items can't overlap, so the nav is
     genuinely centered relative to the full header width without ever
     colliding with the logo, at any screen size. */
  .ct-nav {
    grid-column: 2;
    justify-self: center;
  }

  @media (max-width: 640px) {
    .ct-nav {
        grid-column: 2;
        justify-self: end;
    }
  }

  .ct-nav-dropdown {
    position: relative;
  }

  .ct-nav-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 17px;
    font-weight: 600;
    color: var(--ic-navy);
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 6px;
    transition: background 0.15s;
  }

  .ct-nav-trigger:hover {
    background: #f3f4f6;
  }

  .ct-nav-dropdown.ct-open .ct-nav-trigger {
    background: #f3f4f6;
  }

  .ct-nav-caret {
    width: 13px;
    height: 13px;
    transition: transform 0.15s ease;
  }

  .ct-nav-dropdown.ct-open .ct-nav-caret {
    transform: rotate(180deg);
  }

  .ct-mega-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--ic-border);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
    padding: 20px 24px;
    z-index: 300;
    min-width: 260px;
    max-width: calc(100vw - 40px);
  }

  .ct-nav-dropdown.ct-open .ct-mega-menu {
    display: block;
  }

  .ct-mega-col-title {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 12.5px;
    color: #3b82f6;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 12px;
  }

  .ct-mega-col-title:hover {
    text-decoration: underline;
  }

  .ct-mega-col-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ct-mega-col-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #1f2937;
    text-decoration: none;
    white-space: nowrap;
  }

  .ct-mega-col-list a:hover {
    color: #3b82f6;
  }

  .ct-mega-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #e6a23c;
  }

  .ct-mega-tool-icon svg {
    width: 100%;
    height: 100%;
    max-width: 15px;
    max-height: 15px;
    display: block;
  }

  @media (max-width: 500px) {
    .ct-nav-trigger {
        font-size: 14px;
        padding: 6px 10px;
    }

    .ct-mega-menu {
        left: 12px;
        right: 12px;
        top: 64px;
        position: fixed;
        transform: none;
        min-width: 0;
        max-width: none;
    }

    .ct-mega-col-list a {
        white-space: normal;
    }
  }

  h1 { font-size: 24px; margin: 0 0 4px; color: var(--ic-navy); text-align:center; }
  .ic-sub { color: var(--ic-navy); font-weight: 600; font-size: 15px; margin-bottom: 22px; text-align:center; }

  /* ==== ACTION BAR ==== */
  .ic-actionbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  .ic-btn {
    background: var(--ic-accent);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .ic-btn:hover { background: var(--ic-accent-dark); }
  .ic-btn:disabled { background: #9ca3af; cursor: not-allowed; }
  .ic-btn-outline {
    background: #fff;
    color: var(--ic-navy);
    border: 1px solid var(--ic-border);
  }
  .ic-btn-outline:hover { border-color: var(--ic-navy); }
  .ic-btn-navy { background: var(--ic-navy); }
  .ic-btn-navy:hover { opacity: 0.9; }

  .ic-settings-btn {
    width: 42px;
    height: 42px;
    border-radius: 7px;
    background: #fff;
    border: 1px solid var(--ic-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ic-navy);
    padding: 0;
  }
  .ic-settings-btn:hover { border-color: var(--ic-accent); color: var(--ic-accent-dark); }
  .ic-settings-btn.ic-settings-active { background: var(--ic-accent); border-color: var(--ic-accent); color: #fff; }
  .ic-settings-btn svg { width: 18px; height: 18px; }

  .ic-global-settings {
    display: none;
    max-width: 420px;
    margin: 0 auto 18px;
    background: #fff;
    border: 1px solid var(--ic-border);
    border-radius: 10px;
    padding: 14px 18px;
  }
  .ic-global-settings.ic-show { display: block; }
  .ic-global-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }
  .ic-global-settings-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ic-navy);
  }
  .ic-global-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
  }
  .ic-global-close:hover { color: var(--ic-navy); }
  .ic-global-settings-label {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
  }
  .ic-global-settings-label .ic-global-quality-val {
    font-weight: 700;
    color: var(--ic-accent-dark);
  }
  .ic-global-settings input[type="range"] {
    width: 100%;
    accent-color: var(--ic-accent);
  }
  .ic-global-settings-hint {
    font-size: 11.5px;
    color: #9ca3af;
    margin-top: 6px;
  }

  #icFileInput { display: none; }

  /* ==== DROP ZONE (hero) ==== */
  .ic-drop {
    border: 2px dashed var(--ic-accent);
    border-radius: 12px;
    padding: 46px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #f0fdf9;
  }
  .ic-drop:hover, .ic-drop.ic-dragover {
    border-color: var(--ic-accent-dark);
    background: #e3fbf3;
  }
  .ic-drop svg { width: 42px; height: 42px; color: var(--ic-accent); margin-bottom: 10px; }
  .ic-drop-text { font-size: 15px; font-weight: 700; color: var(--ic-navy); }
  .ic-drop-sub { font-size: 13px; color: #4b5563; margin-top: 5px; }

  /* ==== SUMMARY STRIP (appears once files processed) ==== */
  .ic-summary {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--ic-border);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 18px 0;
    flex-wrap: wrap;
    gap: 12px;
  }
  .ic-summary.ic-show { display: flex; }
  .ic-summary-stats { display: flex; gap: 22px; flex-wrap: wrap; }
  .ic-summary-stat { text-align: left; }
  .ic-summary-stat .ic-stat-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--ic-navy);
  }
  .ic-summary-stat.ic-saved .ic-stat-val { color: var(--ic-accent-dark); }
  .ic-summary-stat .ic-stat-lbl {
    font-size: 11.5px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
  }

  /* ==== PROGRESS INDICATOR (right side of the summary bar, stays visible) ==== */
  .ic-summary-progress {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 160px;
  }
  .ic-summary-progress.ic-show { display: flex; }
  .ic-progress-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
  }
  .ic-progress-label { color: var(--ic-navy); font-weight: 600; }
  .ic-progress-count { color: #6b7280; }
  .ic-progress-track {
    width: 160px;
    height: 7px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
  }
  .ic-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--ic-accent);
    border-radius: 5px;
    transition: width 0.25s ease;
  }
  .ic-progress-fill.ic-progress-done { background: var(--ic-accent-dark); }
  .ic-progress-pct {
    font-size: 11.5px;
    color: var(--ic-accent-dark);
    font-weight: 700;
  }

  /* ==== THUMBNAIL GRID ==== */
  .ic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 18px;
  }
  .ic-card {
    background: #fff;
    border: 1px solid var(--ic-border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    position: relative;
  }
  .ic-card:hover { border-color: var(--ic-accent); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
  .ic-card.ic-open { border-color: var(--ic-accent); }

  .ic-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f3f4f6;
    overflow: hidden;
  }
  .ic-thumb-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }
  .ic-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--ic-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
  }

  /* ==== ICON BUTTONS (download + adjust gear), overlaid bottom of thumbnail ==== */
  .ic-icon-row {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
  }
  .ic-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ic-navy);
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  }
  .ic-icon-btn:hover { color: var(--ic-accent-dark); }
  .ic-icon-btn svg { width: 15px; height: 15px; }
  .ic-icon-btn.ic-gear-active { background: var(--ic-accent); color: #fff; }

  .ic-card-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.55);
  }
  .ic-spin {
    width: 22px; height: 22px;
    border: 3px solid var(--ic-border);
    border-top-color: var(--ic-accent);
    border-radius: 50%;
    animation: ic-spin 0.7s linear infinite;
  }
  @keyframes ic-spin { to { transform: rotate(360deg); } }

  .ic-card-info {
    padding: 9px 10px 11px;
  }
  .ic-card-name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ic-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
  }
  .ic-card-sizes {
    font-size: 11px;
    color: #6b7280;
  }
  .ic-card-sizes .ic-after { color: var(--ic-accent-dark); font-weight: 700; }

  /* ==== INLINE ADJUST (expands directly under its own thumbnail, inside the same card) ==== */
  .ic-inline-adjust {
    display: none;
    padding: 10px 10px 12px;
    border-top: 1px solid var(--ic-border);
    background: #f9fafb;
  }
  .ic-inline-adjust.ic-show { display: block; }
  .ic-inline-compare {
    font-size: 11.5px;
    color: #4b5563;
    margin-bottom: 8px;
  }
  .ic-inline-compare .ic-after { color: var(--ic-accent-dark); font-weight: 700; }
  .ic-inline-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .ic-inline-controls input[type="range"] {
    flex: 1;
    accent-color: var(--ic-accent);
  }
  .ic-inline-quality-val {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ic-accent-dark);
    width: 32px;
    text-align: right;
  }

  .ic-note {
    font-size: 13px;
    color: #6b7280;
    margin-top: 22px;
    text-align: center;
  }

  @media (max-width: 500px) {
    .ic-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .ic-drop { padding: 34px 16px; }
  }

  /* =============================================
     SHARED WRAPPER for sections below the tool
     (bottom description, FAQ, share row) - keeps
     them aligned to the same content width as the
     tool itself, sitting inside compressor_default.
     ============================================= */
  .cmp-wrap {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 15px;
  }

  /* =============================================
     BOTTOM DESCRIPTION
     ============================================= */
  .cmp-bottom-desc {
    background: #fff;
    border: 1px solid var(--ic-border);
    border-radius: 12px;
    padding: 26px 28px;
    margin-top: 28px;
    font-size: 14px;
    line-height: 1.8;
    color: #4b5563;
  }
  .cmp-bottom-desc h2,
  .cmp-bottom-desc h3 {
    color: var(--ic-navy);
    margin: 18px 0 8px;
    font-size: 18px;
  }
  .cmp-bottom-desc h2:first-child,
  .cmp-bottom-desc h3:first-child { margin-top: 0; }
  .cmp-bottom-desc p { margin-bottom: 10px; }

  /* =============================================
     FAQ SECTION - deliberately NOT the navy-header
     card style used by Pdf Tools; uses a simple
     left accent bar + teal plus/minus icon instead.
     ============================================= */
  .cmp-faq-section {
    margin-top: 20px;
  }
  .cmp-faq-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--ic-navy);
    margin-bottom: 14px;
  }
  .cmp-faq-list { display: flex; flex-direction: column; gap: 10px; }
  .cmp-faq-item {
    background: #fff;
    border: 1px solid var(--ic-border);
    border-left: 3px solid var(--ic-accent);
    border-radius: 8px;
    overflow: hidden;
  }
  .cmp-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--ic-navy);
    text-align: left;
    cursor: pointer;
  }
  .cmp-faq-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ecfdf5;
    color: var(--ic-accent-dark);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
  }
  .cmp-faq-answer {
    display: none;
    padding: 0 16px 16px;
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.7;
  }
  .cmp-faq-item.cmp-faq-open .cmp-faq-answer { display: block; }
  .cmp-faq-item.cmp-faq-open .cmp-faq-icon { transform: rotate(45deg); }

  /* =============================================
     SHARE ROW - horizontal pill buttons on a plain
     white strip, not Pdf Tools' navy-header card
     with circular icons.
     ============================================= */
  .cmp-share-row {
    margin-top: 20px;
    background: #fff;
    border: 1px solid var(--ic-border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
  }
  .cmp-share-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ic-navy);
    white-space: nowrap;
  }
  .cmp-share-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cmp-share-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--ic-border);
    background: #fff;
    color: var(--ic-navy);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  }
  .cmp-share-pill svg { width: 14px; height: 14px; }
  .cmp-share-pill:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
  .cmp-share-whatsapp svg { color: #25d366; }
  .cmp-share-facebook svg { color: #1877f2; }
  .cmp-share-twitter svg { color: #000; }
  .cmp-share-linkedin svg { color: #0a66c2; }
  .cmp-share-copy.cmp-copied { background: var(--ic-accent); border-color: var(--ic-accent); color: #fff; }

  /* =============================================
     FLOATING FEEDBACK WIDGET - bottom-right pill
     button + popup panel, distinct from Pdf Tools'
     side-edge floating icon.
     ============================================= */
  .cmp-feedback-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 200;
  }
  .cmp-feedback-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ic-navy);
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  }
  .cmp-feedback-toggle:hover { background: #16213e; }
  .cmp-feedback-toggle svg { width: 17px; height: 17px; }

  .cmp-feedback-panel {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    overflow: hidden;
  }
  .cmp-feedback-panel.cmp-open { display: block; }
  .cmp-feedback-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ic-accent);
    color: #fff;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 700;
  }
  .cmp-feedback-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
  }
  .cmp-feedback-panel-body { padding: 14px 16px; }
  .cmp-feedback-panel-body textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--ic-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
  }
  .cmp-feedback-panel-body textarea:focus { outline: none; border-color: var(--ic-accent); }
  .cmp-feedback-submit {
    width: 100%;
    background: var(--ic-navy);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }
  .cmp-feedback-submit:hover { opacity: 0.9; }
  .cmp-feedback-submit:disabled { background: #9ca3af; cursor: not-allowed; }

  @media (max-width: 500px) {
    .cmp-feedback-widget { right: 14px; bottom: 14px; }
    .cmp-feedback-panel { width: calc(100vw - 28px); }
    .cmp-share-row { flex-direction: column; align-items: flex-start; }
  }

  /* =============================================
     FILE LIST ROWS - used by Compress PDF (and any
     future compressor tool that lists files rather
     than a thumbnail grid, e.g. non-image documents
     where a visual preview isn't practical).
     ============================================= */
  .cp-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
  }
  .cp-item {
    background: #fff;
    border: 1px solid var(--ic-border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
  }
  .cp-item-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .cp-item-icon svg { width: 22px; height: 22px; }
  .cp-item-info { flex: 1; min-width: 0; }
  .cp-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ic-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cp-item-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
  .cp-item-meta .cp-after { color: var(--ic-accent-dark); font-weight: 700; }
  .cp-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
  .cp-item-spinner {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
  }

  @media (max-width: 500px) {
    .cp-item { flex-wrap: wrap; }
  }