/* ── ARUNIWAVES OFFLINE TOOLS PURE MONOCHROME + BLUE ACCENT STYLESHEET ── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&family=Fira+Code:wght@400;500;700&display=swap');

:root {
  --ink: #FFFFFF;
  --ink2: #F3F4F6;
  --ink3: #E5E7EB;
  --light: #F9FAFB;
  --card: #FFFFFF;
  
  --text: #111827;
  --muted: #4B5563;
  --border: #D1D5DB;
  --border2: #9CA3AF;

  /* Minimalist Photogenic Blue Accent Only */
  --blue-accent: #2563EB;
  --green-accent: #2563EB;
  --rose-accent: #2563EB;

  --wave: #2563EB;
  --sea: #1D4ED8;
  --sand: #EFF6FF;

  --sans: 'Inter', sans-serif;
  --title-sans: 'Outfit', sans-serif;
  --mono: 'Fira Code', monospace;
  --header-bg: rgba(255, 255, 255, 0.98);
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  --hover-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
}

html.dark {
  color-scheme: dark;
  --ink: #111827;
  --ink2: #1F2937;
  --ink3: #374151;
  --light: #0B0F19;
  --card: #1F2937;
  --text: #F9FAFB;
  --muted: #9CA3AF;
  --border: #374151;
  --border2: #4B5563;
  --header-bg: rgba(31, 41, 55, 0.98);

  --blue-accent: #3B82F6;
  --green-accent: #3B82F6;
  --rose-accent: #3B82F6;

  --wave: #3B82F6;
  --sea: #2563EB;
  --sand: rgba(59, 130, 246, 0.15);
}

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

body {
  font-family: var(--sans);
  background-color: var(--light);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* ── TOP NAV HEADER (56px STICKY) ── */
.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  height: 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.theme-toggle-btn {
  background: var(--ink2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-left: auto;
}

.theme-toggle-btn:hover {
  background: var(--ink3);
  border-color: var(--border2);
}

/* ── DESKTOP LAYOUT (STRICT RULE 3 ENFORCEMENT) ── */
.subpage-desktop-layout {
  display: flex;
  min-height: calc(100vh - 56px);
  position: relative;
}

/* 1. SIDEBAR NAVIGATION (FIXED 255px DESKTOP LOCK, LEFT 24px) */
.app-sidebar-nav {
  position: fixed !important;
  top: 80px !important;
  left: 24px;
  width: 255px !important;
  z-index: 100 !important;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  box-shadow: var(--card-shadow);
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}

/* 2. SUBPAGE CONTENT (MARGIN-LEFT 304px FOR SPACIOUS 25px GAP) */
.subpage-content {
  margin-left: 304px !important;
  width: calc(100% - 304px) !important;
  padding: 24px 32px 48px 0 !important;
}

.subpage-content > *:first-child {
  margin-top: 0 !important;
}

/* ── SIDEBAR LINKS ── */
.sidebar-links-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── SIDEBAR CATEGORY FILTER ITEMS (INTERACTIVE BERANDA SIDEBAR) ── */
.sidebar-category-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 4px 12px 8px 12px;
}

.sidebar-filter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.sidebar-filter-item:hover {
  background: var(--ink2);
  color: var(--text);
  border-color: var(--border);
}

.sidebar-filter-item.active {
  background: var(--sand) !important;
  color: var(--wave) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
  font-weight: 700 !important;
}

.sidebar-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--ink2);
  color: var(--muted);
  transition: all 0.2s ease;
}

.sidebar-filter-item.active .sidebar-count-badge {
  background: rgba(59, 130, 246, 0.2) !important;
  color: var(--wave) !important;
}

.sidebar-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sidebar-link-item:hover {
  background: var(--ink2);
  color: var(--text);
}

.sidebar-link-item.active {
  background: var(--ink2);
  color: var(--text);
  font-weight: 700;
}

.sidebar-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

/* ── ELEGANT PAGE TITLE HEADER WITH GRADIENT FADE SEPARATOR ── */
.page-title-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 20px;
  width: 100%;
}

.page-title-text {
  font-family: var(--title-sans);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
}

.header-divider-line {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--wave) 0%, rgba(59, 130, 246, 0.25) 40%, transparent 85%);
  border-radius: 2px;
  margin-top: 10px;
}

.hero-subtitle {
  font-size: 13px;
  opacity: 0.85;
  max-width: 680px;
  line-height: 1.45;
}

/* ── SECTION TITLE WRAPPER ── */
.section-title-wrap {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title {
  font-family: var(--title-sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 16px;
  background: var(--ink2);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── MODULE SEARCH & CATEGORY FILTER BAR ── */
.tools-filter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.search-input-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.tool-search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-family: var(--sans);
  outline: none;
  transition: all 0.2s ease;
}

.tool-search-input:focus {
  border-color: var(--wave);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.category-pill-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.category-pill-btn:hover {
  background: var(--sand);
  color: var(--wave);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.pill-count-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 12px;
  background: var(--ink2);
  color: var(--muted);
  margin-left: 4px;
}

.category-pill-btn.active .pill-count-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #FFFFFF !important;
}

.mobile-only-filter {
  display: none !important;
}

.desktop-only-filter {
  display: flex !important;
}

/* ── MODERN HORIZONTAL BANNER CARDS GRID ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
}

@media (max-width: 900px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

.tool-card-horizontal {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 16px 20px !important;
  border-radius: 14px !important;
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  text-decoration: none !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: var(--card-shadow) !important;
}

.tool-card-horizontal:hover {
  transform: translateY(-2px) !important;
  border-color: var(--wave) !important;
  box-shadow: 0 10px 28px -6px rgba(37, 99, 235, 0.18) !important;
}

.tool-card-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--sand) !important;
  color: var(--wave) !important;
  border: 1px solid rgba(37, 99, 235, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.tool-card-horizontal:hover .tool-card-icon-box {
  transform: scale(1.06);
  background: var(--wave) !important;
  color: #FFFFFF !important;
  border-color: transparent !important;
}

.tool-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tool-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tool-card-title {
  font-family: var(--title-sans);
  font-size: 15.5px;
  font-weight: 700 !important;
  color: var(--text) !important;
  margin: 0;
  line-height: 1.25;
}

.tool-card-cat-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--ink2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.tool-card-desc {
  font-size: 12.5px;
  font-weight: 400 !important;
  color: var(--muted) !important;
  line-height: 1.4;
  margin: 0;
}

.tool-card-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink2);
  color: var(--muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.tool-card-horizontal:hover .tool-card-action {
  background: var(--wave) !important;
  color: #FFFFFF !important;
  border-color: transparent !important;
  transform: translateX(3px);
}

.tool-card:hover .tool-card-arrow {
  background: var(--wave) !important;
  color: #FFFFFF !important;
  border-color: var(--wave) !important;
  transform: translateX(3px);
}

.tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-card .tool-card-title {
  font-family: var(--title-sans);
  font-size: 15.5px;
  font-weight: 700 !important;
  color: var(--text) !important;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.25;
}

.tool-card:hover .tool-card-title {
  color: var(--wave) !important;
}

.tool-card .tool-card-desc {
  font-size: 12.5px;
  font-weight: 400 !important;
  color: var(--muted) !important;
  line-height: 1.45;
}

html.dark .tool-card {
  background: #1F2937 !important;
  border-color: #374151 !important;
}

html.dark .tool-card .tool-card-icon {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60A5FA !important;
}

html.dark .tool-card .tool-card-arrow {
  background: #374151 !important;
  color: #9CA3AF !important;
}

html.dark .tool-card:hover .tool-card-arrow {
  background: #3B82F6 !important;
  color: #FFFFFF !important;
}

html.dark .tool-card:hover .tool-card-title {
  color: #60A5FA !important;
}

/* ── SUBPAGE PANEL & DROPZONE STYLING ── */
.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}

.panel-card-title-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.panel-card-title-header .card-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--sand);
  color: var(--wave);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.panel-card-title-header .card-title-text {
  font-family: var(--title-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--text) !important;
}

.mobile-tool-picker {
  display: none !important;
}

.tab-buttons {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-buttons::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent !important;
  border: none !important;
  color: var(--muted);
  padding: 8px 4px 12px 4px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--wave) !important;
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--wave);
  border-radius: 2px 2px 0 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.dropzone {
  border: 2px dashed var(--border2);
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  background: var(--ink2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--wave);
  background: var(--sand);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px auto;
  color: var(--wave);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-text {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.dropzone-subtext,
.dropzone-hint {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
  opacity: 0.85;
}

/* ── PREVIEW CONTAINER STYLING ── */
/* ── STUDIO SPLIT 2-COLUMN WORKSPACE LAYOUT (DESKTOP) ── */
.studio-split-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
}

.studio-controls-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.studio-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: sticky;
  top: 24px;
}

@media (max-width: 900px) {
  .studio-split-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .studio-preview-col {
    position: static;
  }
}

.preview-container {
  display: flex;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  margin-top: 20px;
  box-sizing: border-box;
}

.preview-canvas {
  max-width: 100% !important;
  max-height: 480px !important;
  object-fit: contain !important;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

/* ── PASFOTO COLOR SWATCHES STYLING ── */
.color-swatches {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 10px;
}

.color-swatch {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  border: 2.5px solid transparent !important;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  position: relative;
  box-sizing: border-box;
}

.color-swatch:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

.color-swatch.active {
  border-color: var(--wave) !important;
  transform: scale(1.15) !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.4) !important;
}

.color-swatch.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

.color-swatch[data-color="#FFFFFF"].active::after {
  color: #111827 !important;
  text-shadow: none !important;
}

/* ── SLEEK RAINBOW CUSTOM COLOR PICKER BUTTON ── */
.color-picker-wrapper {
  position: relative;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid var(--border);
  box-sizing: border-box;
}

.color-picker-wrapper:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
  border-color: var(--wave);
}

.color-picker-rainbow {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #FF2D55, #FF9500, #FFCC00, #4CD964, #5AC8FA, #007AFF, #5856D6, #FF2D55);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.color-picker-native {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ── BUTTONS & FORM INPUTS (FORM-INPUT, FORM-CONTROL, FORM-TEXTAREA) ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: #1F2937 !important;
  color: #FFFFFF !important;
  border: 1px solid #374151 !important;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.12);
}

.btn-primary:hover {
  background: #111827 !important;
  border-color: #2563EB !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

html.dark .btn-primary {
  background: #F9FAFB !important;
  color: #111827 !important;
  border: 1px solid #E5E7EB !important;
}

html.dark .btn-primary:hover {
  background: #FFFFFF !important;
  border-color: #3B82F6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--ink2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--ink3) !important;
  color: var(--wave) !important;
  border-color: var(--wave) !important;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control, .form-input, .form-select, .form-textarea, .mobile-tool-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--text);
  font-size: 13.5px;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* SLEEK CUSTOM DROPDOWN ARROW FOR ALL SELECT ELEMENTS */
select.form-control, select.form-select, select.form-input, .mobile-tool-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 40px !important;
  cursor: pointer;
}

html.dark select.form-control, html.dark select.form-select, html.dark select.form-input, html.dark .mobile-tool-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.form-control:focus, .form-input:focus, .form-select:focus, .form-textarea:focus, .mobile-tool-select:focus {
  border-color: var(--wave);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ── NAV BACK BUTTON (SUBPAGES TOPBAR) ── */
.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--ink2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-back-btn:hover {
  background: var(--ink3);
  color: var(--wave);
  border-color: var(--wave);
  transform: translateX(-2px);
}

/* ── MOBILE RESPONSIVE OPTIMIZATION (<768px) ── */
@media (max-width: 768px) {
  /* TOPNAV MOBILE OPTIMIZATION */
  .topnav {
    padding: 0 12px !important;
    height: 56px !important;
  }

  .nav-logo {
    gap: 8px !important;
  }

  .nav-logo img {
    height: 26px !important;
    width: auto !important;
  }

  .nav-logo span:last-child,
  .nav-logo div span:last-child {
    display: none !important;
  }

  .nav-back-btn span,
  .theme-toggle-btn span {
    display: none !important;
  }

  .nav-back-btn, .theme-toggle-btn {
    padding: 6px 10px !important;
    border-radius: 50px !important;
  }

  /* MAIN LAYOUT MOBILE OPTIMIZATION */
  .subpage-desktop-layout {
    display: flex !important;
    flex-direction: column !important;
    padding-top: 16px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 30px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* HIDE SIDEBAR COMPLETELY ON MOBILE */
  .app-sidebar-nav {
    display: none !important;
  }

  /* SUBPAGE CONTENT FULL WIDTH ON MOBILE */
  .subpage-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .dashboard-body-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .subpage-content > *:first-child {
    margin-top: 0 !important;
  }

  /* HIDE DESKTOP TAB BUTTONS ON MOBILE WHEN MOBILE DROPDOWN IS ACTIVE */
  .tab-buttons {
    display: none !important;
  }

  .mobile-tool-picker {
    display: block !important;
    margin-bottom: 16px !important;
  }

  /* BERANDA DASHBOARD MOBILE HERO & FILTER BAR */
  .hero-banner {
    padding: 16px 14px !important;
    border-radius: 12px !important;
    margin-bottom: 14px !important;
  }

  .hero-title {
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  .hero-subtitle {
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  .section-title-wrap {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    margin-bottom: 12px !important;
  }

  .section-title {
    font-size: 16px !important;
  }

  .tools-filter-wrapper {
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .search-input-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  .mobile-only-filter {
    display: block !important;
    width: 100% !important;
  }

  .desktop-only-filter {
    display: none !important;
  }

  .mobile-category-select {
    width: 100% !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    background-color: var(--card) !important;
    color: var(--text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: var(--sans) !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
  }

  /* ULTRA-COMPACT MOBILE CARDS FOR BERANDA DASHBOARD */
  .tools-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .tool-card-horizontal {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .tool-card-icon-box {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  .tool-card-icon-box svg {
    width: 16px !important;
    height: 16px !important;
  }

  .tool-card-title {
    font-size: 14.5px !important;
    line-height: 1.3 !important;
  }

  .tool-card-desc {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .tool-card-action {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
  }
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  .tool-card-arrow svg {
    width: 11px !important;
    height: 11px !important;
  }

  .tool-card-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    width: 100% !important;
  }

  .tool-card-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    line-height: 1.25 !important;
  }

  .tool-card-desc {
    font-size: 11.5px !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    opacity: 0.85 !important;
  }

  /* PANEL CARDS & DROPZONE ON MOBILE */
  .panel-card {
    padding: 14px !important;
    border-radius: 12px !important;
  }

  .panel-card-title-header .card-title-text {
    font-size: 16px !important;
  }

  .dropzone {
    padding: 20px 12px !important;
  }

  .dropzone-text {
    font-size: 13px !important;
  }

  /* LIGHTROOM WEB 2-COLUMN STUDIO GRID COLLAPSE ON MOBILE */
  #lightroom-workspace > div {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  #lightroom-workspace div[style*="height:600px"] {
    height: 360px !important;
  }

  #lightroom-workspace div[style*="margin-top:38px"] {
    margin-top: 0 !important;
    height: auto !important;
  }

  /* PSX EMULATOR FRAME ON MOBILE */
  #emulator-display-container div[style*="height:620px"] {
    height: 380px !important;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* HIDE MOBILE TOOL PICKER DROPDOWN ON DESKTOP BY DEFAULT */
.mobile-tool-picker {
  display: none !important;
}

/* ── SUDOKU MASTER REBUILD 1:1 DESIGN STYLES ── */
.sudoku-rebuild-layout {
  display: grid !important;
  grid-template-columns: 460px 320px !important;
  gap: 32px !important;
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 auto !important;
  align-items: start !important;
}

@media (max-width: 840px) {
  .sudoku-rebuild-layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

.sudoku-diff-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex-wrap: wrap;
}

.sudoku-diff-link {
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.sudoku-diff-link:hover {
  color: var(--wave);
}

.sudoku-diff-link.active {
  color: #2563EB !important;
  font-weight: 800 !important;
}

.sudoku-stats-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  font-size: 12px;
  color: var(--muted);
}

.sudoku-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sudoku-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.sudoku-stat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.sudoku-board-rebuild {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  background: #FFFFFF !important;
  border: 2.5px solid #1E3A8A !important;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  user-select: none;
}

.sudoku-cell-rebuild {
  background: #FFFFFF !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 400;
  color: #1E3A8A;
  cursor: pointer;
  transition: background 0.12s ease;
  position: relative;
  border-right: 1px solid #CBD5E1;
  border-bottom: 1px solid #CBD5E1;
  box-sizing: border-box;
}

/* 3x3 BLOCK BORDER LINES */
.sudoku-cell-rebuild:nth-child(3n) {
  border-right: 2.5px solid #1E3A8A !important;
}
.sudoku-cell-rebuild:nth-child(9n) {
  border-right: none !important;
}
.sudoku-cell-rebuild:nth-child(n+19):nth-child(-n+27),
.sudoku-cell-rebuild:nth-child(n+46):nth-child(-n+54) {
  border-bottom: 2.5px solid #1E3A8A !important;
}
.sudoku-cell-rebuild:nth-child(n+73):nth-child(-n+81) {
  border-bottom: none !important;
}

.sudoku-cell-rebuild.given {
  background: #FFFFFF !important;
  color: #1E3A8A !important;
  font-weight: 500 !important;
  cursor: default;
}

.sudoku-cell-rebuild.selected {
  background: #DBEAFE !important;
  z-index: 2;
}

.sudoku-cell-rebuild.highlighted {
  background: #F1F5F9 !important;
}

.sudoku-cell-rebuild.same-number {
  background: #E0F2FE !important;
  color: #1E40AF !important;
}

.sudoku-cell-rebuild.error {
  background: #FEE2E2 !important;
  color: #DC2626 !important;
  font-weight: 700 !important;
}

/* CIRCULAR ACTION BUTTONS */
.sudoku-circle-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 16px;
}

.sudoku-circle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #EFF6FF;
  border: none;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.sudoku-circle-btn:hover {
  background: #DBEAFE;
  transform: translateY(-2px);
}

.sudoku-circle-btn .badge-pill {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #2563EB;
  color: #FFF;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

/* 3x3 NUMPAD GRID */
.sudoku-numpad-rebuild {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.sudoku-numpad-btn {
  background: #EFF6FF;
  border: none;
  border-radius: 14px;
  height: 80px;
  font-size: 32px;
  font-weight: 400;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sudoku-numpad-btn:hover {
  background: #DBEAFE;
  color: #1E3A8A;
  transform: scale(1.02);
}

.sudoku-numpad-btn:active {
  transform: scale(0.97);
}

/* NEW GAME FULL WIDTH BUTTON */
.sudoku-new-game-full {
  width: 100%;
  background: #4C72B0;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 0;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(76, 114, 176, 0.3);
}

.sudoku-new-game-full:hover {
  background: #3B5A90;
  transform: translateY(-1px);
}

.sudoku-num-btn.erase-btn:hover {
  background: rgba(225, 29, 72, 0.1);
  color: #E11D48;
}

