/* PicDriver - Printing & Framing Online Tools CSS (Enhanced & Animated) */

/* Layout & Container */
.pfc-workspace {
  max-width: var(--max-width, 1280px);
  margin: 0 auto;
  padding: 0 20px 60px 20px;
}

/* Tool Hero Banner */
.tool-hero {
  text-align: center;
  padding: 40px 20px 28px;
  max-width: 860px;
  margin: 0 auto;
}

.tool-hero h1 {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f8fafc 20%, #cbd5e1 60%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.tool-hero p {
  color: var(--text-secondary, #94a3b8);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Cross-Link Banner to Standalone Dedicated Tool */
.suite-cross-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg, 16px);
  padding: 14px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.suite-cross-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.suite-cross-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.suite-cross-text {
  font-size: 0.92rem;
  color: #e2e8f0;
}

.suite-cross-text strong {
  color: #ffffff;
}

.suite-cross-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #6366f1;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.suite-cross-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  color: #fff;
}

.link-standalone-pfs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #818cf8;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 6px;
  transition: color 0.2s ease;
}

.link-standalone-pfs:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Tool Chips Bar */
.tool-chips-wrapper {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 20px);
  padding: 16px 20px;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tool-chips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tool-chips-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-primary, #6366f1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-chips-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-chip {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #94a3b8);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.tool-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
  border-color: var(--brand-primary, #6366f1);
  transform: translateY(-1px);
}

.tool-chip.active {
  background: var(--brand-primary, #6366f1);
  color: #ffffff;
  border-color: var(--brand-primary, #6366f1);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  font-weight: 600;
}

/* Tabs Header */
.pfc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  padding: 6px;
  border-radius: var(--radius-md, 14px);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  margin-bottom: 28px;
  backdrop-filter: blur(12px);
}

.pfc-tab-btn {
  flex: 1;
  min-width: 160px;
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  padding: 11px 18px;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pfc-tab-btn:hover {
  color: var(--text-primary, #f8fafc);
  background: rgba(255, 255, 255, 0.05);
}

.pfc-tab-btn.active {
  color: #ffffff;
  background: var(--brand-primary, #6366f1);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

/* Content Panels */
.pfc-panel {
  display: none;
  animation: pfcFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.pfc-panel.active {
  display: block;
}

@keyframes pfcFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 2-Column Split: Controls on Left, Live Interactive Frame on Right */
.pfc-split-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}

@media (max-width: 980px) {
  .pfc-split-layout {
    grid-template-columns: 1fr;
  }
}

/* Calculator Grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.calc-card {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 14px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.calc-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.calc-card-header {
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding-bottom: 12px;
}

.calc-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 6px;
  line-height: 1.45;
}

/* Forms & Inputs */
.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

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

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-sm, 8px);
  padding: 10px 14px;
  color: var(--text-primary, #f8fafc);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand-primary, #6366f1);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Result Box */
.calc-result-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 8px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calc-result-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.calc-result-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  letter-spacing: -0.02em;
}

.calc-result-label {
  font-size: 0.78rem;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calc-result-breakdown {
  font-size: 0.84rem;
  color: var(--text-secondary, #94a3b8);
  border-top: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-row strong {
  color: var(--text-primary, #f8fafc);
}

/* Quality Pills */
.quality-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quality-pill.high {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.quality-pill.medium {
  background: rgba(234, 179, 8, 0.16);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.quality-pill.low {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* =========================================================
   🔥 LIVE ANIMATED FRAME & PREVIEW STUDIO
   ========================================================= */

.frame-studio-panel {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 20px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding-bottom: 12px;
}

.studio-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-badge {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Live Interactive Framing Stage */
.live-frame-stage {
  position: relative;
  width: 100%;
  height: 360px;
  background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  perspective: 1000px;
}

/* Wall Background Texture Options */
.live-frame-stage.wall-concrete {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}
.live-frame-stage.wall-brick {
  background: linear-gradient(to bottom, #2b1f1d 0%, #171110 100%);
}
.live-frame-stage.wall-living {
  background: linear-gradient(to bottom, #1e293b 0%, #0f172a 75%, #334155 75%, #1e293b 100%);
}

/* Animated Outer Frame Molding */
.anim-frame-outer {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              height 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              padding 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  user-select: none;
}

.anim-frame-outer:hover {
  transform: scale(1.02) rotateY(3deg) rotateX(-2deg);
}

/* Frame Finish Materials */
.anim-frame-outer.molding-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 50%, #fef3c7 70%, #d97706 100%);
  border: 2px solid #fbbf24;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(245, 158, 11, 0.25);
}

.anim-frame-outer.molding-wood {
  background: linear-gradient(135deg, #451a03 0%, #78350f 45%, #291003 100%);
  border: 2px solid #92400e;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

.anim-frame-outer.molding-black {
  background: linear-gradient(135deg, #18181b 0%, #27272a 50%, #09090b 100%);
  border: 2px solid #3f3f46;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.05);
}

.anim-frame-outer.molding-white {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #ffffff 100%);
  border: 2px solid #cbd5e1;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.2);
}

.anim-frame-outer.molding-silver {
  background: linear-gradient(135deg, #94a3b8 0%, #cbd5e1 45%, #64748b 70%, #e2e8f0 100%);
  border: 2px solid #e2e8f0;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(148, 163, 184, 0.25);
}

/* Animated Mat Board */
.anim-mat-board {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.anim-mat-board.mat-offwhite {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.anim-mat-board.mat-cream {
  background: #fefce8;
  border: 1px solid #fef08a;
}

.anim-mat-board.mat-black {
  background: #0f172a;
  border: 1px solid #334155;
}

.anim-mat-board.mat-charcoal {
  background: #334155;
  border: 1px solid #475569;
}

.anim-mat-board.mat-none {
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Bevel Cut Core Highlight on Mat Window */
.anim-mat-bevel {
  position: absolute;
  inset: -2px;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Artwork Photo Core */
.anim-art-canvas {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #020617;
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
  transition: width 0.3s ease, height 0.3s ease;
}

/* Dynamic Living Landscape SVG Animation */
.art-animated-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.scene-sky-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Animated Elements */
.anim-sun {
  animation: sunGlowPulse 4s ease-in-out infinite alternate;
}

@keyframes sunGlowPulse {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 12px #f59e0b); }
}

.anim-clouds-layer {
  animation: cloudsDrift 24s linear infinite;
}

@keyframes cloudsDrift {
  0% { transform: translateX(0); }
  50% { transform: translateX(40px); }
  100% { transform: translateX(0); }
}

.anim-water-line {
  animation: waterShimmer 2.5s ease-in-out infinite alternate;
}

.anim-water-line.line-2 {
  animation-delay: 0.8s;
}

.anim-water-line.line-3 {
  animation-delay: 1.4s;
}

@keyframes waterShimmer {
  0% { transform: translateX(-8px) scaleX(0.9); opacity: 0.3; }
  100% { transform: translateX(12px) scaleX(1.1); opacity: 0.85; }
}

/* Realistic Glass Reflection Glare */
.anim-art-glass-glare {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.12) 30%,
    rgba(255, 255, 255, 0) 65%
  );
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.3s ease;
}

/* =========================================================
   🔥 REVERSE CONTRAST DYNAMIC TEXT BADGE
   Guaranteed visibility at all times using backdrop-filter
   and CSS difference / high-contrast blending.
   ========================================================= */

.anim-art-meta {
  position: relative;
  z-index: 4;
  padding: 8px 16px;
  border-radius: var(--radius-sm, 8px);
  max-width: 86%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

/* Auto-Reverse Mode: High-contrast frosted glass with reverse-weighted text */
.anim-art-meta.contrast-reverse {
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
}

.anim-art-meta.contrast-reverse .anim-art-title {
  color: #f8fafc;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  letter-spacing: 0.08em;
}

.anim-art-meta.contrast-reverse .anim-art-dims {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  font-weight: 700;
}

/* Dark Glass Contrast Mode */
.anim-art-meta.contrast-glass-dark {
  background: rgba(0, 0, 0, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
}

.anim-art-meta.contrast-glass-dark .anim-art-title {
  color: #ffffff;
}

.anim-art-meta.contrast-glass-dark .anim-art-dims {
  color: #4ade80;
}

/* Bright Glass Contrast Mode (Reverse Black on White) */
.anim-art-meta.contrast-glass-light {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.anim-art-meta.contrast-glass-light .anim-art-title {
  color: #0f172a;
  font-weight: 800;
}

.anim-art-meta.contrast-glass-light .anim-art-dims {
  color: #2563eb;
  font-weight: 800;
}

.anim-art-title {
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
}

.anim-art-dims {
  font-size: 0.74rem;
  font-family: var(--font-mono, monospace);
  margin-top: 3px;
}

/* Studio Customizer Controls */
.studio-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 8px);
  padding: 14px;
}

.style-selector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.style-selector-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
}

/* =========================================================
   📐 REAL-TIME DIMENSIONAL ACCURACY CARD & METRICS
   ========================================================= */

.accuracy-metrics-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm, 8px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.accuracy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.accuracy-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.accuracy-badge.verified {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.accuracy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.accuracy-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.accuracy-stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
}

.accuracy-stat-val {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
}

/* Image Fit Modes on Canvas */
.anim-art-canvas.fit-exact .scene-sky-svg,
.anim-art-canvas.fit-exact .user-art-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.anim-art-canvas.fit-contain .scene-sky-svg,
.anim-art-canvas.fit-contain .user-art-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.anim-art-canvas.fit-cover .scene-sky-svg,
.anim-art-canvas.fit-cover .user-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.style-buttons {
  display: flex;
  gap: 6px;
}

.style-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-sm, 8px);
  color: var(--text-primary, #f8fafc);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.style-btn:hover {
  border-color: var(--brand-primary, #6366f1);
  color: #ffffff;
}

.style-btn.active {
  background: var(--brand-primary, #6366f1);
  border-color: var(--brand-primary, #6366f1);
  color: #ffffff;
}

/* Reference Frame Swatches */
.frame-swatches-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.frame-swatch-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 14px);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.frame-swatch-item:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.frame-swatch-mini {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.frame-swatch-item:hover .frame-swatch-mini {
  transform: scale(1.1);
}

.frame-swatch-mini.mini-gold {
  background: #000;
  border: 5px solid #d97706;
}

.frame-swatch-mini.mini-wood {
  background: #000;
  border: 5px solid #78350f;
}

.frame-swatch-mini.mini-black {
  background: #000;
  border: 5px solid #27272a;
}

.frame-swatch-mini.mini-white {
  background: #000;
  border: 5px solid #f8fafc;
}

.frame-swatch-mini.mini-silver {
  background: #000;
  border: 5px solid #94a3b8;
}

.frame-swatch-inner {
  width: 26px;
  height: 26px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-swatch-art {
  width: 16px;
  height: 16px;
  background: #3b82f6;
  border-radius: 2px;
}

.frame-swatch-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
}

.frame-swatch-desc {
  font-size: 0.68rem;
  color: var(--text-secondary, #94a3b8);
}

/* Furniture Mockup in Studio */
.wall-scene {
  position: relative;
  width: 100%;
  height: 300px;
  background: linear-gradient(to bottom, #1e293b 0%, #0f172a 70%, #334155 70%, #1e293b 100%);
  border-radius: var(--radius-md, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.wall-furniture {
  position: absolute;
  bottom: 0;
  width: 70%;
  height: 55px;
  background: #475569;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wall-art-frame {
  background: #000;
  border: 4px solid #d97706;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 40px;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wall-art-mat {
  background: #f8fafc;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.wall-art-photo {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Reference Table & FAQ */
.ref-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 8px);
  margin-top: 12px;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.ref-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #f8fafc);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.ref-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  color: var(--text-secondary, #94a3b8);
}

.ref-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
}

/* FAQ Accordion */
.faq-item {
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.faq-question {
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.03);
}

.faq-answer {
  padding: 0 18px 14px 18px;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.88rem;
  line-height: 1.55;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-icon {
  transition: transform 0.2s ease;
}

@media (max-width: 640px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .form-group-row, .form-group-3 {
    grid-template-columns: 1fr;
  }
  .frame-swatches-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tool-hero h1 {
    font-size: 1.8rem;
  }
}

/* ===== ADVANCED FRAMING GEOMETRY & UNIT CONTROLS ===== */
.unit-toggle-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 8px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.unit-toggle-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.unit-toggle-pills {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
}

.unit-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unit-pill:hover {
  color: #ffffff;
}

.unit-pill.active {
  background: var(--brand-primary, #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Quick Preset Chips Row */
.preset-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-chips-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.preset-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  color: var(--text-secondary, #cbd5e1);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--brand-primary, #6366f1);
  color: #ffffff;
}

.preset-chip.active {
  background: var(--brand-primary, #6366f1);
  border-color: var(--brand-primary, #6366f1);
  color: #ffffff;
}

/* Input with Unit Badge */
.input-with-badge {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-badge .form-input {
  width: 100%;
  padding-right: 42px;
}

.input-unit-badge {
  position: absolute;
  right: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  pointer-events: none;
  font-family: var(--font-mono, monospace);
}

.field-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  margin-top: 1px;
}

/* Advanced Geometry Section */
.advanced-geometry-section {
  margin-top: 8px;
  border-top: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding-top: 10px;
}

.advanced-toggle-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--brand-accent, #e0a96d);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.18s ease;
}

.advanced-toggle-btn:hover {
  color: #fcd34d;
}

.adv-chevron {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.advanced-toggle-btn.open .adv-chevron {
  transform: rotate(180deg);
}

.btn-reset-calc {
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  color: var(--text-secondary, #94a3b8);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-calc:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Studio View Mode Switcher */
.studio-view-toggle {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  gap: 3px;
}

.view-toggle-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-pill:hover {
  color: #ffffff;
}

.view-toggle-pill.active {
  background: var(--brand-primary, #6366f1);
  color: #ffffff;
}

/* Blueprint Stage */
.blueprint-frame-stage {
  background: #020617;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md, 12px);
  padding: 16px 12px 10px;
  text-align: center;
  position: relative;
  background-image: 
    linear-gradient(to right, rgba(99, 102, 241, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.06) 1px, transparent 1px);
  background-size: 16px 16px;
}

#blueprintSvg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.blueprint-caption {
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--brand-accent, #e0a96d);
  font-family: var(--font-mono, monospace);
  font-weight: 500;
}

/* Use Size Table Button */
.btn-use-size {
  background: linear-gradient(135deg, #e0a96d 0%, #c98a4b 100%);
  color: #0f172a;
  border: none;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-use-size:hover {
  background: linear-gradient(135deg, #fcd34d 0%, #e0a96d 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(224, 169, 109, 0.4);
}

/* ===== VISUAL DIAGRAM (Reference Style from picture-frame-calculator.html) ===== */
.diagram-wrap {
  background: #ffffff;
  border: 1.5px solid #e8dfd3;
  border-radius: 12px;
  padding: 24px 18px;
  text-align: center;
  margin: 18px 0 0 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  color: #2c2117;
  position: relative;
  overflow: hidden;
}

.diagram-wrap h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: #4a3728;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

#frameDiagram,
#studioFrameDiagram {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.diagram-caption {
  font-size: 12px;
  color: #8b6f4e;
  margin-top: 12px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
}

/* Custom Value Option Elements */
.preset-chip-custom {
  background: rgba(201, 145, 61, 0.15) !important;
  border-color: #c9913d !important;
  color: #e8b870 !important;
  font-weight: 700 !important;
}

.preset-chip-custom.active {
  background: linear-gradient(135deg, #c9913d 0%, #a87030 100%) !important;
  border-color: #fcd34d !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(201, 145, 61, 0.4) !important;
}

.custom-value-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(201, 145, 61, 0.18);
  border: 1px solid rgba(201, 145, 61, 0.4);
  color: #fcd34d;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quick-preset-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.quick-preset-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quick-preset-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.quick-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #cbd5e1);
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-pill:hover,
.quick-pill.active {
  background: rgba(201, 145, 61, 0.25);
  border-color: #c9913d;
  color: #fcd34d;
}

.live-frame-dims-text {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  font-family: var(--font-mono, monospace);
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 10px;
}

.btn-use-custom {
  background: linear-gradient(135deg, #c9913d 0%, #a87030 100%) !important;
  color: #ffffff !important;
  border: 1px solid #fcd34d !important;
  font-weight: 700 !important;
}

.btn-use-custom:hover {
  background: linear-gradient(135deg, #fcd34d 0%, #c9913d 100%) !important;
  color: #1e293b !important;
  box-shadow: 0 2px 12px rgba(201, 145, 61, 0.5) !important;
}

