    :root {
      --bg: #191918;
      --sidebar: #191918;
      --panel: #2F2F2F;
      --border: rgba(255, 255, 255, 0.13);
      --text: rgba(255, 255, 255, 0.95);
      --text-muted: rgba(255, 255, 255, 0.6);
      --text-disabled: rgba(255, 255, 255, 0.3);
      --accent: #2383E2;
      --accent-hover: #1a6bb8;
      --danger: #EB5757;
      --warning: #F2C94C;
      --success: #6FCF97;
    }

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

    body {
      font-family: NotionInter, Inter, -apple-system, "system-ui", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      height: 100vh;
      overflow: hidden;
      font-feature-settings: "lnum", "locl" 0;
      word-break: break-word;
      overflow-wrap: break-word;
      line-height: 1.5;
    }

    .container {
      display: flex;
      height: 100vh;
      position: relative;
    }

    /* Sidebar */
    .sidebar {
      width: 600px;
      min-width: 300px;
      max-width: 80%;
      background: var(--sidebar);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
    }

    /* Resizer */
    .resizer {
      width: 4px;
      background: transparent;
      cursor: col-resize;
      position: relative;
      flex-shrink: 0;
      transition: background .15s;
    }

    .resizer:hover,
    .resizer.resizing {
      background: rgba(255, 255, 255, 0.3);
    }

    .sidebar-header {
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      min-height: auto;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .sidebar-title {
      font-size: 14px;
      font-weight: 600;
    }

    .sidebar-subtitle {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .sidebar-toolbar {
      padding: 8px 12px;
      border-bottom: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .toolbar-row {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    /* Settings popup */
    .settings-wrapper {
      position: relative;
    }

    .settings-popup {
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 4px;
      background: #2F2F2F;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      padding: 10px 12px;
      min-width: 180px;
      z-index: 100;
      display: flex;
      flex-direction: column;
      gap: 10px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .settings-popup.hidden {
      display: none;
    }

    .settings-row {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text);
      white-space: nowrap;
    }

    .settings-row label {
      color: var(--text-muted);
    }

    .settings-row input[type="number"] {
      padding: 4px 6px;
      font-size: 12px;
    }

    .sidebar-content {
      flex: 1;
      overflow-y: auto;
      padding: 8px;
    }

    .drop-zone {
      border: 1px dashed rgba(255, 255, 255, 0.13);
      border-radius: 8px;
      padding: 8px;
      min-height: 150px;
      background: transparent;
      transition: all .2s;
      position: relative;
    }

    .drop-zone.drag {
      border-color: rgba(255, 255, 255, 0.5);
      background: rgba(255, 255, 255, 0.03);
    }

    .empty-state {
      text-align: center;
      padding: 24px 12px;
      color: var(--text-muted);
      font-size: 13px;
    }

    .empty-state-icon {
      font-size: 36px;
      margin-bottom: 8px;
      opacity: 0.4;
    }

    .thumbs {
      --size: 100px;
      display: grid;
      grid-template-columns: repeat(auto-fill, var(--size));
      gap: 6px;
      position: relative;
    }

    .thumbs.list-view {
      display: block;
    }

    .thumb.list-item {
      display: flex;
      align-items: center;
      gap: 8px;
      aspect-ratio: auto;
      padding: 4px 8px;
      margin-bottom: 2px;
      border-radius: 4px;
    }

    .thumb.list-item img {
      width: 28px;
      height: 28px;
      flex-shrink: 0;
      border-radius: 3px;
    }

    .thumb.list-item .file-info {
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .thumb.list-item .file-name {
      font-size: 12px;
      font-weight: 400;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .thumb.list-item .file-meta {
      font-size: 11px;
      color: var(--text-muted);
      white-space: nowrap;
      flex-shrink: 0;
    }

    .thumb.list-item:hover {
      transform: none;
      background: rgba(255, 255, 255, 0.03);
    }

    .thumb.list-item .thumb-overlay {
      position: static;
      opacity: 1;
      background: none;
      flex-direction: row;
      padding: 0;
      gap: 6px;
      align-items: center;
    }

    .thumb.list-item .thumb-tools {
      margin-left: auto;
    }

    .thumb.list-item .thumb-badge {
      margin-right: 0;
    }

    .thumb {
      position: relative;
      aspect-ratio: 1;
      border: 1px solid transparent;
      border-radius: 8px;
      overflow: hidden;
      cursor: pointer;
      background: #2F2F2F;
      transition: all .15s;
    }

    .thumb:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .thumb.sel {
      border-color: rgba(255, 255, 255, 0.8);
      box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
    }

    .thumb.t99 {
      border-color: #f59e0b;
      box-shadow: 0 0 0 1px #f59e0b;
    }

    .thumb-overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 6px;
      opacity: 0;
      transition: opacity .15s;
    }

    .thumb:hover .thumb-overlay {
      opacity: 1;
    }

    .thumb-tools {
      display: flex;
      justify-content: flex-end;
      gap: 4px;
    }

    .thumb-badges {
      display: flex;
      gap: 4px;
      align-items: flex-end;
    }

    .thumb-badge {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      background: rgba(0, 0, 0, 0.6);
      padding: 3px 6px;
      border-radius: 3px;
      font-size: 10px;
      font-weight: 600;
    }

    .thumb.wm::after {
      content: '💧';
      position: absolute;
      top: 4px;
      left: 4px;
      font-size: 12px;
      background: rgba(0, 0, 0, 0.5);
      border-radius: 3px;
      padding: 2px 4px;
    }

    .sidebar-footer {
      padding: 8px 12px;
      border-top: 1px solid var(--border);
      font-size: 11px;
      color: var(--text-muted);
      line-height: 1.5;
    }

    /* Main area */
    .main {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .main-header {
      padding: 10px 16px;
      border-bottom: 1px solid var(--border);
      background: var(--sidebar);
      min-height: auto;
      display: flex;
      align-items: center;
    }

    .main-title {
      font-size: 14px;
      font-weight: 600;
    }

    .main-content {
      flex: 1;
      overflow-y: auto;
      padding: 16px;
    }

    .section {
      margin-bottom: 16px;
    }

    .section-header {
      padding: 8px 0;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      user-select: none;
      margin-bottom: 12px;
    }

    .section-header:hover {
      color: var(--text);
    }

    .section-title {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .section-arrow {
      font-size: 9px;
      transition: transform .2s;
      color: var(--text-muted);
    }

    .section.open .section-arrow {
      transform: rotate(90deg);
    }

    .section-body {
      max-height: 0;
      overflow: hidden;
      transition: max-height .2s;
    }

    .section.open .section-body {
      max-height: 1000px;
    }

    .section-content {
      padding: 0;
    }

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

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

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

    .form-control {
      width: 100%;
      padding: 7px 10px;
      background: #2F2F2F;
      border: 1px solid rgba(255, 255, 255, 0.13);
      border-radius: 6px;
      color: var(--text);
      font-size: 13px;
      transition: border-color .15s, box-shadow .15s;
    }

    .form-control:focus {
      outline: none;
      border-color: rgba(255, 255, 255, 0.5);
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
    }

    .form-row {
      display: grid;
      gap: 8px;
    }

    .form-row.cols-2 {
      grid-template-columns: 1fr 1fr;
    }

    .form-row.cols-auto {
      grid-template-columns: 1fr auto;
    }

    .checkbox-label {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text);
      cursor: pointer;
    }

    .checkbox {
      width: 14px;
      height: 14px;
      cursor: pointer;
      accent-color: rgba(255, 255, 255, 0.8);
    }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 6px 12px;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 8px;
      color: var(--text);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all .15s;
      white-space: nowrap;
    }

    .btn:hover {
      background: rgba(255, 255, 255, 0.05);
      border-color: var(--text-muted);
    }

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

    .btn-primary {
      background: #FFFFFF;
      border-color: #FFFFFF;
      color: #191918;
    }

    .btn-primary:hover {
      background: rgba(255, 255, 255, 0.9);
      border-color: rgba(255, 255, 255, 0.9);
    }

    .btn-danger {
      color: var(--danger);
      border-color: var(--danger);
      background: transparent;
    }

    .btn-danger:hover {
      background: rgba(244, 33, 46, 0.1);
    }

    .btn[disabled] {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .btn[disabled]:hover {
      transform: none;
      background: transparent;
      border-color: var(--border);
    }

    .btn-block {
      width: 100%;
    }

    .btn-sm {
      padding: 5px 10px;
      font-size: 11px;
    }

    .btn-icon {
      padding: 6px;
      width: 26px;
      height: 26px;
      border-radius: 50%;
    }

    /* Progress */
    .progress-bar {
      height: 3px;
      background: var(--border);
      border-radius: 2px;
      overflow: hidden;
      margin: 12px 0;
    }

    .progress-fill {
      height: 100%;
      width: 0;
      background: rgba(255, 255, 255, 0.7);
      transition: width .3s;
    }

    .progress-text {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 6px;
    }

    /* Results */
    .results-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
      gap: 8px;
    }

    .result-item {
      position: relative;
      aspect-ratio: 1;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      overflow: hidden;
      background: #2F2F2F;
      transition: all .15s;
    }

    .result-item:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .result-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .result-overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 50%);
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
      gap: 6px;
      padding: 8px;
      opacity: 0;
      transition: opacity .15s;
    }

    .result-item:hover .result-overlay {
      opacity: 1;
    }

    .result-filename {
      font-size: 10px;
      text-align: center;
      word-break: break-all;
      max-height: 32px;
      overflow: hidden;
    }

    /* Modal */
    .modal {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.95);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }

    .modal.hidden {
      display: none;
    }

    .modal-img {
      max-width: 90vw;
      max-height: 90vh;
      object-fit: contain;
      border-radius: 4px;
    }

    .modal-close {
      position: absolute;
      top: 12px;
      right: 12px;
    }

    .modal-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
    }

    .modal-prev {
      left: 12px;
    }

    .modal-next {
      right: 12px;
    }

    /* Alerts */
    .alert {
      padding: 10px 12px;
      border-radius: 8px;
      font-size: 12px;
      margin-bottom: 12px;
      border-left: 3px solid;
    }

    .alert-warning {
      background: rgba(242, 201, 76, 0.1);
      border-left-color: #F2C94C;
      color: #F2C94C;
    }

    .alert-info {
      background: rgba(35, 131, 226, 0.1);
      border-left-color: #2383E2;
      color: #2383E2;
    }

    .alert-error {
      background: rgba(235, 87, 87, 0.1);
      border-left-color: #EB5757;
      color: #EB5757;
    }

    /* Utilities */
    .hidden {
      display: none !important;
    }

    .text-muted {
      color: var(--text-muted);
    }

    .text-sm {
      font-size: 11px;
    }

    .text-xs {
      font-size: 10px;
    }

    .mt-2 {
      margin-top: 6px;
    }

    .mb-2 {
      margin-bottom: 6px;
    }

    /* Drop overlay */
    .drop-overlay {
      position: fixed;
      inset: 0;
      background: rgba(10, 17, 25, 0.92);
      backdrop-filter: blur(4px);
      z-index: 99999;
      display: none;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }

    .drop-overlay.active {
      display: flex;
    }

    /* Disable pointer events on children during drag */
    .drop-overlay.active~* * {
      pointer-events: none !important;
    }

    .drop-overlay-content {
      text-align: center;
      color: var(--text);
      pointer-events: none;
    }

    .drop-overlay-icon {
      font-size: 48px;
      margin-bottom: 12px;
      animation: bounce 1s ease-in-out infinite;
    }

    .drop-overlay-text {
      font-size: 18px;
      font-weight: 600;
    }

    @keyframes bounce {

      0%,
      100% {
        transform: translateY(0);
      }

      50% {
        transform: translateY(-8px);
      }
    }

    /* Spinner */
    .spinner {
      width: 24px;
      height: 24px;
      border: 2px solid var(--border);
      border-top-color: rgba(255, 255, 255, 0.7);
      border-radius: 50%;
      animation: spin .8s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .processing-overlay {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      z-index: 10;
    }

    .processing-text {
      font-size: 11px;
      color: var(--text);
    }

    /* Range slider */
    input[type="range"] {
      -webkit-appearance: none;
      appearance: none;
      height: 3px;
      background: var(--border);
      border-radius: 2px;
      outline: none;
      vertical-align: middle;
    }

    input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 14px;
      height: 14px;
      background: rgba(255, 255, 255, 0.8);
      border-radius: 50%;
      cursor: pointer;
      margin-top: 0;
      position: relative;
    }

    input[type="range"]::-moz-range-thumb {
      width: 14px;
      height: 14px;
      background: rgba(255, 255, 255, 0.8);
      border-radius: 50%;
      cursor: pointer;
      border: none;
    }

    input[type="range"]::-moz-range-track {
      height: 3px;
      background: var(--border);
      border-radius: 2px;
    }

    /* Drop indicator - hidden by default, kept for compatibility */
    .drop-indicator {
      display: none;
    }

    /* SortableJS: Ghost element (placeholder in list) */
    .sortable-ghost {
      background: rgba(255, 255, 255, 0.08) !important;
      border: 2px dashed rgba(255, 255, 255, 0.5) !important;
      opacity: 0.6;
    }

    .sortable-ghost * {
      visibility: hidden;
    }

    /* SortableJS: Chosen element (being dragged) */
    .sortable-chosen {
      opacity: 1;
    }

    /* SortableJS: Dragging element (in flight) */
    .sortable-drag {
      border: 2px solid rgba(255, 255, 255, 0.5) !important;
      border-radius: 8px;
      background: #2F2F2F;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
      opacity: 0.95;
    }

    /* Drag cursor styles */
    .thumb {
      cursor: grab;
    }

    .thumb:active,
    .sortable-chosen {
      cursor: grabbing;
    }

    /* Responsive */
    @media(max-width: 768px) {
      .container {
        flex-direction: column;
      }

      .sidebar {
        width: 100% !important;
        min-width: 100%;
        max-width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
      }

      .resizer {
        width: 100%;
        height: 4px;
        cursor: row-resize;
      }

      .main {
        height: 60vh;
      }
    }

    /* SVG Icon Support */
    svg {
      vertical-align: middle;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .icon {
      width: 16px;
      height: 16px;
      stroke-width: 2;
    }

    .btn-icon svg {
      width: 16px;
      height: 16px;
    }

    .btn-icon {
      padding: 4px;
      width: 28px;
      height: 28px;
      border-radius: 8px;
    }

    /* Watermark Indicator */
    .thumb.wm::after {
      content: none;
    }

    .wm-indicator {
      position: absolute;
      top: 4px;
      left: 4px;
      color: rgba(255, 255, 255, 0.9);
      background: rgba(0, 0, 0, 0.4);
      padding: 2px;
      border-radius: 4px;
      display: flex;
      pointer-events: none;
    }

    /* Comparison View */
    .compare-slider {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      width: 2px;
      background: rgba(255, 255, 255, 0.8);
      cursor: col-resize;
      z-index: 10;
      transform: translateX(-50%);
      touch-action: none;
    }

    .compare-handle {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 32px;
      height: 32px;
      background: #fff;
      border-radius: 50%;
      color: #333;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    }

    .modal-image-wrapper {
      position: relative;
      display: inline-block;
      line-height: 0;
      /* Removing gap */
    }

    .modal-content-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
    }

    .modal-preview-btn {
      z-index: 20;
    }

    /* Toast Notification */
    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: rgba(111, 207, 151, 0.95);
      color: white;
      padding: 16px 20px;
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      display: flex;
      align-items: center;
      gap: 12px;
      z-index: 10000;
      animation: slideIn 0.3s ease-out;
      max-width: 400px;
      backdrop-filter: blur(10px);
    }

    .toast.error {
      background: rgba(235, 87, 87, 0.95);
    }

    .toast-icon {
      font-size: 20px;
      flex-shrink: 0;
    }

    .toast-content {
      flex: 1;
    }

    .toast-title {
      font-weight: 600;
      font-size: 14px;
      margin-bottom: 4px;
    }

    .toast-message {
      font-size: 12px;
      opacity: 0.9;
      word-break: break-word;
    }

    @keyframes slideIn {
      from {
        transform: translateX(400px);
        opacity: 0;
      }

      to {
        transform: translateX(0);
        opacity: 1;
      }
    }

    @keyframes slideOut {
      from {
        transform: translateX(0);
        opacity: 1;
      }

      to {
        transform: translateX(400px);
        opacity: 0;
      }
    }

    /* Settings Modal */
    .settings-modal {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1001;
      backdrop-filter: blur(4px);
    }

    .settings-modal.hidden {
      display: none;
    }

    .settings-panel {
      background: #2F2F2F;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 12px;
      width: 90%;
      max-width: 420px;
      max-height: 80vh;
      overflow: hidden;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
      animation: modalScaleIn 0.2s ease-out;
    }

    @keyframes modalScaleIn {
      from {
        transform: scale(0.95);
        opacity: 0;
      }
      to {
        transform: scale(1);
        opacity: 1;
      }
    }

    .settings-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
    }

    .settings-panel-header h3 {
      font-size: 16px;
      font-weight: 600;
      margin: 0;
    }

    .settings-panel-body {
      padding: 20px;
      overflow-y: auto;
      max-height: calc(80vh - 60px);
    }

    .settings-section {
      margin-bottom: 20px;
    }

    .settings-section:last-child {
      margin-bottom: 0;
    }

    /* Radio Cards */
    .radio-cards {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 8px;
    }

    .radio-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 14px;
      background: #191918;
      border: 1px solid rgba(255, 255, 255, 0.13);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .radio-card:hover {
      border-color: var(--text-muted);
    }

    .radio-card:has(input:checked) {
      border-color: rgba(255, 255, 255, 0.5);
      background: rgba(255, 255, 255, 0.05);
    }

    .radio-card input {
      accent-color: rgba(255, 255, 255, 0.8);
    }

    .radio-card-content {
      flex: 1;
    }

    .radio-card-title {
      font-size: 13px;
      font-weight: 500;
      color: var(--text);
    }

    .radio-card-desc {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    /* Modal Toolbar */
    .modal-toolbar {
      display: flex;
      gap: 8px;
      justify-content: center;
      z-index: 20;
    }

    .modal-toolbar .btn {
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 255, 255, 0.2);
    }

    .modal-toolbar .btn:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    /* Modal Image Rotation */
    .modal-img {
      transition: transform 0.3s ease;
    }