/* ImageSprint – Image Compressor page guide. Loaded only on /image-compressor/. All selectors are scoped to .cmp-guide. */
.cmp-guide { padding-bottom: 24px; }
.cmp-guide, .cmp-guide * { box-sizing: border-box; }
.cmp-guide .cmp-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin: 0 0 20px;
}
.cmp-guide h2 { margin: 0 0 12px; font-size: clamp(1.25rem, 2.4vw, 1.6rem); letter-spacing: -0.01em; }
.cmp-guide h3 { margin: 0 0 6px; font-size: 1.02rem; }
.cmp-guide p, .cmp-guide li, .cmp-guide td, .cmp-guide th { color: var(--text-secondary); overflow-wrap: anywhere; }
.cmp-guide p { margin: 0 0 14px; line-height: 1.7; }
.cmp-guide p:last-child { margin-bottom: 0; }
.cmp-guide a:not(.btn) { color: var(--accent); text-underline-offset: 3px; }
.cmp-guide a:not(.btn):hover { color: var(--blue); }
.cmp-guide a:focus-visible, .cmp-guide summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.cmp-guide .cmp-lead { color: var(--text-secondary); }
.cmp-guide .cmp-intro {
  background: var(--surface);
  background-image: none;
}

/* Steps */
.cmp-guide .cmp-steps {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr));
  counter-reset: cmp-step;
}
.cmp-guide .cmp-steps li {
  counter-increment: cmp-step;
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 16px 16px;
  transition: border-color var(--transition), transform var(--transition);
}
.cmp-guide .cmp-steps li::before {
  content: counter(cmp-step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-bottom: 10px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white); font-weight: 700; font-size: 0.9rem;
}
.cmp-guide .cmp-steps li:hover {
  border-color: rgba(91, 192, 222, 0.45);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.cmp-guide .cmp-steps li::before {
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cmp-guide .cmp-steps li:hover::before {
  transform: scale(1.12);
}
.cmp-guide .cmp-steps p { font-size: 0.92rem; }

/* Card grids (Bento Glassmorphism upgrade) */
.cmp-guide .cmp-grid { display: grid; gap: 14px; margin-top: 16px; }
.cmp-guide .cmp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cmp-guide .cmp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cmp-guide .cmp-card {
  display: block;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: border-color 0.26s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  will-change: transform;
}
.cmp-guide .cmp-card p { font-size: 0.92rem; margin: 0; }
.cmp-guide .cmp-card:hover {
  border-color: rgba(91, 192, 222, 0.45);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 38px rgba(0, 0, 0, 0.42), 0 0 26px rgba(91, 192, 222, 0.22);
}
.cmp-guide a.cmp-link-card { text-decoration: none; color: inherit; }
.cmp-guide a.cmp-link-card h3 { color: var(--text); }
.cmp-guide a.cmp-link-card:hover, .cmp-guide a.cmp-link-card:focus-visible {
  border-color: rgba(91, 192, 222, 0.55);
  transform: translateY(-2px);
}
.cmp-guide .cmp-more-read { margin-top: 16px; }

/* Table */
.cmp-guide .cmp-table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cmp-guide .cmp-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 0.93rem; }
.cmp-guide .cmp-table th, .cmp-guide .cmp-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp-guide .cmp-table thead th { background: var(--bg-elevated); color: var(--text); font-weight: 650; }
.cmp-guide .cmp-table tbody th { color: var(--text); font-weight: 650; white-space: nowrap; }
.cmp-guide .cmp-table tbody tr:last-child th, .cmp-guide .cmp-table tbody tr:last-child td { border-bottom: none; }

/* Lists */
.cmp-guide .cmp-list { margin: 8px 0 16px; padding-left: 1.2em; }
.cmp-guide .cmp-list li { margin-bottom: 8px; line-height: 1.65; }
.cmp-guide .cmp-list strong { color: var(--text); }
.cmp-guide .cmp-list-check { list-style: none; padding-left: 0; }
.cmp-guide .cmp-list-check li { position: relative; padding-left: 28px; }
.cmp-guide .cmp-list-check li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 700; }

/* FAQ (native details, no JavaScript) */
.cmp-guide .cmp-faq details { border-bottom: 1px solid var(--line); }
.cmp-guide .cmp-faq details:last-child { border-bottom: none; }
.cmp-guide .cmp-faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 16px 36px 16px 0; color: var(--text); font-weight: 600;
}
.cmp-guide .cmp-faq summary::-webkit-details-marker { display: none; }
.cmp-guide .cmp-faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; color: var(--accent); transition: transform var(--transition);
}
.cmp-guide .cmp-faq details[open] summary::after { content: "\2212"; }
.cmp-guide .cmp-faq summary:hover { color: var(--accent); }
.cmp-guide .cmp-faq details p { padding: 0 0 16px; }

/* Call to action */
.cmp-guide .cmp-cta {
  text-align: center;
  background: none, var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  margin-top: 8px;
}
.cmp-guide .cmp-cta p { max-width: 560px; margin-left: auto; margin-right: auto; }
.cmp-guide .cmp-back { margin-top: 18px; font-size: 0.92rem; }

/* Responsive */
@media (max-width: 960px) {
  .cmp-guide .cmp-steps, .cmp-guide .cmp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cmp-guide .cmp-section { padding: 20px 16px; }
  .cmp-guide .cmp-steps, .cmp-guide .cmp-grid-3, .cmp-guide .cmp-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .cmp-guide .cmp-intro .btn, .cmp-guide .cmp-cta .btn { width: 100%; justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cmp-guide .cmp-steps li:hover, .cmp-guide .cmp-card:hover, .cmp-guide a.cmp-link-card:hover { transform: none; }
}

/* Thematic Collage Custom Enhancements */
.collage-canvas-container[data-bg="wood"] {
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('https://images.unsplash.com/photo-1546484475-7f7bd55792da?auto=format&fit=crop&w=800&q=80') center/cover;
}
.collage-canvas-container[data-bg="dark-slate"] { background: #1e293b; }
.collage-canvas-container[data-bg="soft-blush"] { background: #fbcfe8; }
.collage-grid[data-category="anniversary"] {
    grid-template-columns: 1fr 1fr;
    border: 3px solid #f43f5e;
    border-radius: 20px;
    box-shadow: 0 0 25px rgba(244, 63, 94, 0.3);
}
.collage-grid[data-category="photo-dump"] {
    grid-template-columns: repeat(3, 1fr);
    background: #f8fafc;
    padding: 25px;
}
.collage-slot {
    position: relative;
    border: 2px dashed #475569;
    border-radius: 8px;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.slot-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.slot-btn {
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}

/* Image Retouch & Remove Tool – Mobile Touch & iOS Safari Fixes */
.retouch-stage-wrap {
    position: relative;
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.retouch-canvas {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
.rt-brush-cursor {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    border-radius: 50%;
    box-sizing: border-box;
    z-index: 10;
    transform: translate(-50%, -50%);
    will-change: transform, left, top, width, height;
}
.retouch-submodes[hidden],
[data-rt-remove-panel][hidden] {
    display: none !important;
}
.retouch-remove-panel {
    align-items: center;
}
.retouch-remove-panel [data-rt-rm-apply] {
    margin-left: auto;
}

/* Tool-page SEO Steps & Related Bento Micro-interactions */
.tool-seo .seo-steps {
    list-style: none;
    padding: 0;
    margin: 16px 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    counter-reset: seo-step-counter;
}
.tool-seo .seo-steps li {
    counter-increment: seo-step-counter;
    margin: 0;
    padding: 18px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.24s ease;
    will-change: transform;
}
.tool-seo .seo-steps li::before {
    content: counter(seo-step-counter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-right: 8px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}
.tool-seo .seo-steps li strong {
    display: inline-block;
    color: var(--text);
}
.tool-seo .seo-steps li:hover {
    transform: translate3d(0, -3px, 0);
    border-color: rgba(139, 111, 255, 0.4);
}
@media (prefers-reduced-motion: reduce) {
    .tool-seo .seo-steps li:hover { transform: none; }
}

/* ==========================================================================
   Tool cards & Blog cards smooth scroll reveal animation (v3.16.0)
   ========================================================================== */
.tools-grid .tool-card,
.feature-grid .feature-card,
.blog-archive-grid .blog-card {
    opacity: 0;
    transform: translateY(25px);
    animation: toolCardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition:
        translate 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.28s ease,
        box-shadow 0.3s ease;
}

/* Stagger delay for cards so they appear sequentially */
.tools-grid .tool-card:nth-child(1),
.blog-archive-grid .blog-card:nth-child(1) { animation-delay: 0.05s; }
.tools-grid .tool-card:nth-child(2),
.blog-archive-grid .blog-card:nth-child(2) { animation-delay: 0.10s; }
.tools-grid .tool-card:nth-child(3),
.blog-archive-grid .blog-card:nth-child(3) { animation-delay: 0.15s; }
.tools-grid .tool-card:nth-child(4),
.blog-archive-grid .blog-card:nth-child(4) { animation-delay: 0.20s; }
.tools-grid .tool-card:nth-child(5),
.blog-archive-grid .blog-card:nth-child(5) { animation-delay: 0.25s; }
.tools-grid .tool-card:nth-child(6),
.blog-archive-grid .blog-card:nth-child(6) { animation-delay: 0.30s; }
.tools-grid .tool-card:nth-child(7),
.blog-archive-grid .blog-card:nth-child(7) { animation-delay: 0.35s; }
.tools-grid .tool-card:nth-child(8),
.blog-archive-grid .blog-card:nth-child(8) { animation-delay: 0.40s; }
.tools-grid .tool-card:nth-child(9),
.blog-archive-grid .blog-card:nth-child(9) { animation-delay: 0.45s; }
.tools-grid .tool-card:nth-child(10) { animation-delay: 0.50s; }
.tools-grid .tool-card:nth-child(11) { animation-delay: 0.55s; }
.tools-grid .tool-card:nth-child(12) { animation-delay: 0.60s; }

.feature-grid .feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-grid .feature-card:nth-child(2) { animation-delay: 0.10s; }
.feature-grid .feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-grid .feature-card:nth-child(4) { animation-delay: 0.20s; }

@keyframes toolCardReveal {
    0% {
        opacity: 0;
        transform: translateY(25px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Preserve -6px hover lift even while CSS animation forwards fill is active */
.tools-grid .tool-card:not([data-bento-reveal="ready"]):hover,
.feature-grid .feature-card:not([data-bento-reveal="ready"]):hover,
.blog-archive-grid .blog-card:not([data-bento-reveal="ready"]):hover {
    translate: 0 -6px;
}

@media (prefers-reduced-motion: reduce) {
    .tools-grid .tool-card,
    .feature-grid .feature-card,
    .blog-archive-grid .blog-card {
        opacity: 1 !important;
        transform: none !important;
        translate: none !important;
        animation: none !important;
    }
}




/* ---- Image Resizer controls (v3.23.0) ---- */
.rz-panel{display:grid;gap:14px;margin-top:4px}
.rz-block{display:grid;gap:8px}
.rz-label{font-weight:600;font-size:.92rem}
.rz-chips{display:flex;flex-wrap:wrap;gap:8px}
.rz-chip{border:1px solid var(--line);background:var(--surface);color:inherit;border-radius:8px;padding:7px 14px;font:inherit;font-size:.88rem;cursor:pointer;line-height:1.2}
.rz-chip:hover,.rz-chip:focus-visible{border-color:var(--accent);outline:none}
.rz-info{margin:0;padding:10px 12px;border-radius:8px;background:rgba(91,192,222,.12);border:1px solid var(--line);font-size:.9rem;overflow-wrap:anywhere}
.rz-crop{display:grid;gap:8px}
.rz-stage{position:relative;display:inline-block;max-width:100%;line-height:0;overflow:hidden;border-radius:10px;touch-action:none;user-select:none;-webkit-user-select:none;justify-self:start}
.rz-stage img{display:block;max-width:100%;max-height:420px;height:auto;width:auto;pointer-events:none}
.rz-box{position:absolute;border:2px solid #fff;box-shadow:0 0 0 9999px rgba(0,0,0,.55);cursor:move;touch-action:none;box-sizing:border-box}
.rz-box:focus-visible{outline:3px solid var(--accent);outline-offset:2px}

/* ---- Resizer: touch-friendly + responsive, DNG handoff card (v3.36.0, palette-safe) ---- */
.rz-panel,.rz-panel *{min-width:0;box-sizing:border-box}
.rz-panel input[type=number],.rz-panel select{font-size:16px;min-height:44px;width:100%}
.rz-panel input[type=color]{min-height:44px;width:100%}
.rz-panel input[type=range]{width:100%;min-height:36px;margin:0}
.rz-panel .field-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr))}
.rz-chip{min-height:44px}
.rz-dims{display:grid;grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr);gap:8px;align-items:end;margin-bottom:2px}
.rz-swap{min-height:44px;min-width:44px;border:1px solid var(--line);border-radius:8px;background:transparent;color:inherit;font-size:1.15rem;cursor:pointer}
.rz-swap:hover,.rz-swap:focus-visible{border-color:var(--accent);outline:none}
.rz-actions{display:flex;flex-wrap:wrap;gap:10px}
.rz-actions .btn{min-height:44px}
@media (max-width:480px){
 .rz-chips{gap:6px}
 .rz-chip{flex:1 1 calc(50% - 6px);text-align:center;padding:8px 10px}
 .rz-stage img{max-height:320px}
}
.dz-hint{margin:10px 2px 0;font-size:.9rem}
.dz-hint a{text-decoration:underline}
.raw-handoff{display:grid;gap:6px}
.raw-handoff p{margin:0}
.raw-handoff ol{margin:0 0 0 18px;padding:0}
.tool-status .raw-handoff-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin-top:6px;text-align:center;text-decoration:none;white-space:normal}
.tool-status .next-step a{text-decoration:underline}

/* ---- Retouch: Adjust & Effects panel (v3.37.0, palette variables only) ---- */
.fx-panel{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.fx-panel *{min-width:0;box-sizing:border-box}
.fx-tabs{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.fx-tab,.fx-chip{min-height:44px;padding:8px 16px;border:1px solid var(--line);border-radius:8px;background:transparent;color:inherit;font:inherit;font-size:.92rem;cursor:pointer}
.fx-tab:hover,.fx-chip:hover,.fx-tab:focus-visible,.fx-chip:focus-visible{border-color:var(--accent);outline:none}
.fx-tab.is-active,.fx-chip.is-active{border-color:var(--accent);background:rgba(91,192,222,.14)}
.fx-grid{display:grid;grid-template-columns:1fr;gap:6px 20px}
.fx-group h3{margin:10px 0 4px;font-size:.95rem}
.fx-row{display:grid;gap:4px;margin-bottom:10px}
.fx-row label{font-weight:600;font-size:.9rem}
.fx-row input[type=range]{width:100%;min-height:36px;margin:0}
.fx-row select,.fx-row input[type=color]{min-height:44px;width:100%;font-size:16px}
.fx-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.fx-invert{margin-top:6px}
.fx-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.fx-actions .btn{min-height:44px}
@media (min-width:720px){.fx-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:480px){.fx-chip{flex:1 1 calc(50% - 8px);text-align:center;padding:8px 10px}}


/* v3.38.0 — FX panel inside left sidebar */
.rt-sidebar .fx-panel {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.rt-sidebar .fx-grid {
  grid-template-columns: 1fr;
}
@media (min-width: 992px) {
  .rt-sidebar .fx-grid {
    grid-template-columns: 1fr;
  }
}
.rt-sidebar .fx-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-top: 8px;
  z-index: 1;
}
[data-theme="light"] .rt-sidebar .fx-panel,
[data-theme="light"] .rt-sidebar .fx-actions {
  background: #FFFFFF;
}
