/* ═══════════════════════════════════════════════════════════════════
   PicDriver Copyright & Photographer Utilities - Core Stylesheet
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #101420;
  --bg-card: #141926;
  --bg-card-hover: #1c2438;
  --bg-card-active: #1e263d;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-rose: #f43f5e;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Space Mono', 'Fira Code', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.75);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════ HEADER & NAV ═══════════════ */
.site-header {
  background-color: #05070a;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
}

.header-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--accent-cyan);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-cyan);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ═══════════════ HERO SECTION ═══════════════ */
.hero {
  width: 100%;
  max-width: 1440px;
  margin: 2rem auto 1.25rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
  line-height: 1.2;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent-cyan), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 820px;
  margin: 0 auto;
}

/* ═══════════════ QUICK-SWITCH TOOL STRIP ═══════════════ */
.tool-strip-wrapper {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
}

.tool-strip {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) var(--bg-secondary);
}

.tool-strip::-webkit-scrollbar {
  height: 6px;
}

.tool-strip::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
}

.tool-strip::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-full);
}

.tool-strip::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.tool-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.55rem 1.15rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  user-select: none;
}

.tool-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.4);
}

.tool-chip.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

/* ═══════════════ HORIZONTAL METRICS RIBBON ═══════════════ */
.metrics-ribbon-wrapper {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 1.75rem;
  padding: 0 1.5rem;
}

.metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding-right: 0.75rem;
}

.metric-item:last-child {
  border-right: none;
  padding-right: 0;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value.highlight {
  color: var(--accent-cyan);
}
.metric-value.emerald {
  color: var(--accent-emerald);
}
.metric-value.amber {
  color: var(--accent-amber);
}

/* ═══════════════ MAIN WORKSPACE (2 COLUMNS) ═══════════════ */
.main-workspace {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* LEFT COLUMN: CONTROLS & FORMS */
.config-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.tool-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.tool-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* FORM STYLES */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-label span.hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

select.form-control {
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.65rem;
}

/* SLIDERS & RANGES */
.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.range-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
  transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-val {
  min-width: 48px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* TOGGLE SWITCHES */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--accent-cyan);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* 9-POINT POSITION GRID */
.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.pos-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.pos-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.3);
}

.pos-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

/* COLOR PALETTE PICKER */
.color-picker-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.4rem;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* ACTION BUTTONS */
.btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #05070a;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.45);
}

.btn-secondary {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-outline {
  background: transparent;
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-cyan);
}

/* RIGHT COLUMN: OUTPUT / PREVIEWS / CANVAS */
.output-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.output-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.output-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.output-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.output-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.output-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

/* CANVAS CONTAINER (WATERMARK) */
.canvas-wrapper {
  background: #020408;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

#watermark-canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.canvas-controls-bar {
  width: 100%;
  background: rgba(10, 13, 20, 0.9);
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.canvas-sample-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* DOCUMENT PREVIEW CONTAINER */
.document-container {
  background: #060911;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  font-family: var(--font-sans);
  color: #e2e8f0;
  max-height: 620px;
  overflow-y: auto;
  line-height: 1.65;
}

.document-container::-webkit-scrollbar {
  width: 6px;
}
.document-container::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
}

/* CODE / METADATA PREVIEW */
.code-container {
  background: #03060c;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #a5f3fc;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 520px;
  overflow-y: auto;
  line-height: 1.55;
}

/* LEGAL CONTRACT PREVIEW STYLES */
.legal-contract {
  padding: 1rem 0;
}

.legal-header {
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(56, 189, 248, 0.25);
  padding-bottom: 1rem;
}

.legal-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.legal-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.legal-clause {
  margin-bottom: 1.15rem;
}

.legal-clause h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.legal-clause p {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.legal-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.party-box h5 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
}

.party-box p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.signature-block {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.sig-line {
  border-bottom: 1px solid var(--text-muted);
  height: 40px;
  margin-bottom: 0.4rem;
}

.sig-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* CHECKLIST & AUDIT VIEW */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.checklist-score-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.score-progress-wrap {
  flex: 1;
  margin: 0 1.5rem;
}

.score-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-rose), var(--accent-amber), var(--accent-emerald));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.check-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.3);
}

.check-item.checked {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.check-box-custom {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-shrink: 0;
  transition: var(--transition);
}

.check-item.checked .check-box-custom {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #05070a;
}

.check-content {
  flex: 1;
}

.check-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.check-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ═══════════════ PRO TIPS & EDUCATIONAL ═══════════════ */
.info-section {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.tip-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border-left: 3px solid var(--accent-cyan);
}

.tip-card.amber {
  border-left-color: var(--accent-amber);
}

.tip-card.emerald {
  border-left-color: var(--accent-emerald);
}

.tip-card.purple {
  border-left-color: var(--accent-purple);
}

.tip-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tip-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ═══════════════ 10-TOOL COMPARISON MATRIX ═══════════════ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

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

.matrix-table th {
  background: #060911;
  padding: 0.85rem 1rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.matrix-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.matrix-table tr:hover td {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  cursor: pointer;
}

.matrix-table tr.active-row td {
  background: rgba(56, 189, 248, 0.12);
  color: var(--text-primary);
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-cyan { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.tag-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.tag-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.tag-purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

/* ═══════════════ FAQ ACCORDION ═══════════════ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.15rem 1.25rem;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-question:hover {
  color: var(--accent-cyan);
}

.faq-icon {
  font-size: 1.1rem;
  color: var(--accent-cyan);
  transition: transform 0.3s ease;
}

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

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.85rem;
}

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

/* ═══════════════ FOOTER ═══════════════ */
.site-footer {
  background-color: #05070a;
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* ═══════════════ RESPONSIVE BREAKPOINTS ═══════════════ */
@media (max-width: 1100px) {
  .main-workspace {
    grid-template-columns: 1fr;
  }
  .metrics-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }
  .metric-item:nth-child(3) {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #05070a;
    flex-direction: column;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
    z-index: 1001;
  }
  .nav-links.open,
  .nav-links.show {
    display: flex;
  }
  .hero h1 {
    font-size: 1.75rem;
  }
  .metrics-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.5rem;
  }
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
  .legal-parties-grid,
  .signature-block {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   Universal Mobile & Tablet Responsiveness Suite (320px - 1040px)
   ========================================================================== */

/* 1. Fluid Media & Canvas Scaling */
img, canvas, svg, video {
  max-width: 100% !important;
  height: auto !important;
}

/* 2. Responsive Touch-Scroll Tables */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

.table-responsive,
.table-container,
.table-wrap,
.table-wrapper,
.matrix-container,
.data-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 3. Tablet Breakpoint (<= 1040px) */
@media (max-width: 1040px) {
  .workspace,
  .studio-layout,
  .finder-workspace,
  .simulator-grid,
  .layout-grid,
  .remover-workspace {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .sidebar-panel,
  .controls-sidebar {
    border-left: none !important;
    border-top: 1px solid var(--border, rgba(255,255,255,0.1));
  }
}

/* 4. Mobile Portrait & Landscape (<= 768px) */
@media (max-width: 768px) {
  .site-header {
    height: auto !important;
    padding: 10px 16px !important;
  }

  .header-inner,
  .header-container {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
  }

  .logo,
  .brand-logo,
  .logo-wrap {
    font-size: 1.15rem !important;
  }

  .menu-toggle {
    display: block !important;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #0a0d14;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    z-index: 1000;
  }

  .nav-links.open {
    display: flex !important;
  }

  .hero {
    padding: 28px 16px 20px !important;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 5.5vw, 2.3rem) !important;
    line-height: 1.2 !important;
  }

  .hero p {
    font-size: 0.92rem !important;
  }

  .page-wrapper,
  .portal-main,
  .container {
    padding: 16px 12px 40px !important;
  }

  .workspace,
  .studio-layout,
  .finder-workspace,
  .remover-workspace {
    padding: 0 !important;
    gap: 16px !important;
  }

  .panel-card,
  .results-card,
  .sidebar-panel,
  .stage-area,
  .card {
    padding: 16px 14px !important;
    border-radius: 12px !important;
  }

  .metrics-grid,
  .data-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .calc-grid,
  .features-grid,
  .steps-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .tool-chips-grid,
  .chips-bar,
  .preset-chip-group,
  .mode-tabs {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .tool-chip,
  .preset-btn,
  .mode-tab-btn {
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
  }

  .btn-primary,
  .btn-secondary,
  .action-btn,
  .btn-action {
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }

  .btn-group,
  .action-btns,
  .download-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }

  th, td {
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
  }
}

/* 5. Small Handsets (<= 480px) */
@media (max-width: 480px) {
  .hero-pill,
  .hero-badge {
    font-size: 0.72rem !important;
    padding: 3px 10px !important;
  }

  .form-group {
    margin-bottom: 14px !important;
  }

  .form-control,
  .form-select,
  .control-input,
  .control-select,
  input[type="text"],
  input[type="number"],
  select {
    font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
    min-height: 42px;
  }

  .info-section,
  .guide-section,
  .faq-section {
    padding: 24px 12px !important;
  }
}
