/* =========================================
   MADING DIGITAL — style.css
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #f5f0e8;
  --panel: #fffdf8;
  --border: #d4c9b0;
  --text: #2c2416;
  --text2: #7a6e5f;
  --accent: #c8763a;
  --accent2: #4a7c59;
  --pin: #d64c2e;
  --sidebar-w: 280px;
  --toolbar-w: 52px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
  user-select: none;
  background: var(--bg);
  touch-action: none; /* cegah browser scroll default di mobile */
}


/* =========================================
   TITLE HEADER (top center)
   ========================================= */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: rgba(255,253,248,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  pointer-events: none;
}

#site-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-align: center;
  cursor: text;
  border: none;
  background: transparent;
  outline: none;
  padding: 2px 8px;
  border-radius: 6px;
  transition: background 0.15s, box-shadow 0.15s;
  pointer-events: all;
  min-width: 80px;
  max-width: 500px;
  width: auto;
}
#site-title:hover {
  background: rgba(200,118,58,0.07);
}
#site-title:focus {
  background: rgba(200,118,58,0.1);
  box-shadow: 0 0 0 2px rgba(200,118,58,0.3);
}

#title-edit-hint {
  font-size: 11px;
  color: var(--text2);
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
#site-header:hover #title-edit-hint {
  opacity: 1;
}

/* Push board-wrap down so header doesn't overlap */
#board-wrap {
  top: 45px !important;
}
#empty-hint {
  top: calc(50% + 22px) !important;
}

/* =========================================
   BOARD
   ========================================= */
#board-wrap {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: default;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(200,118,58,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(74,124,89,0.07) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23b8a88a' fill-opacity='0.12'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto;
  touch-action: none;
}

#board {
  position: absolute;
  top: 0; left: 0;
  width: 4000px; height: 3000px;
  transform-origin: 0 0;
  touch-action: none;
}

/* =========================================
   LEFT TOOLBAR (collapsible icon strip)
   ========================================= */
#toolbar {
  position: fixed;
  left: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: rgba(255,253,248,0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 14px 14px 0;
  box-shadow: 4px 0 20px rgba(0,0,0,0.09);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1), opacity 0.28s;
}

#toolbar.hidden {
  transform: translateY(-50%) translateX(calc(-100% - 1px));
}

#toolbar-toggle {
  position: fixed;
  left: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  width: 22px; height: 48px;
  background: var(--accent);
  border: none; border-radius: 0 10px 10px 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 3px 0 10px rgba(200,118,58,0.35);
  transition: left 0.28s cubic-bezier(.4,0,.2,1), background 0.15s;
  color: white;
}
#toolbar-toggle:hover { background: #a85e28; }
#toolbar-toggle .toggle-arrow {
  font-size: 11px;
  transition: transform 0.28s;
  line-height: 1;
}
#toolbar-toggle.shifted {
  left: var(--toolbar-w);
}
#toolbar-toggle.shifted .toggle-arrow { transform: rotate(180deg); }

.tb-icon-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.tb-icon-btn:hover {
  background: #f0ebe0;
  border-color: var(--border);
  color: var(--accent);
}
.tb-icon-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.tb-icon-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.tb-icon-btn .tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%; transform: translateY(-50%);
  background: var(--text);
  color: white;
  font-size: 12px; font-weight: 500;
  padding: 5px 10px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.tb-icon-btn .tooltip::before {
  content: '';
  position: absolute;
  right: 100%; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--text);
}
.tb-icon-btn:hover .tooltip { opacity: 1; }

.tb-divider {
  width: 28px; height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.tb-logo-mark {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 4px;
  line-height: 1;
}

/* =========================================
   ZOOM CONTROLS (bottom right)
   ========================================= */
#zoom-bar {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 1000;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,253,248,0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.zoom-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text);
  transition: background 0.15s;
}
.zoom-btn:hover { background: #f0ebe0; }
.zoom-btn svg { width: 14px; height: 14px; }
#zoom-val {
  font-size: 13px; font-weight: 500;
  color: var(--text);
  min-width: 44px; text-align: center;
}

/* =========================================
   PHOTO ITEMS
   ========================================= */
.photo-item {
  position: absolute;
  cursor: move;
  transition: filter 0.15s;
  touch-action: none;
}
.photo-item:hover { z-index: 500 !important; }
.photo-item.selected { z-index: 600 !important; }
.photo-item.dragging { z-index: 700 !important; }

.photo-wrap {
  position: relative;
  overflow: hidden;
}
.photo-wrap img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* Pin */
.photo-pin {
  position: absolute; top: -16px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
  z-index: 2; pointer-events: none;
}
.photo-pin circle { fill: var(--pin); }
.photo-pin .pin-needle { stroke: rgba(0,0,0,0.3); stroke-width: 1.5; }

/* Tape */
.photo-tape {
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 64px; height: 22px;
  background: rgba(214,199,168,0.72);
  border: 1px solid rgba(180,165,130,0.4);
  border-radius: 2px;
  z-index: 2; pointer-events: none;
}

/* Corner peel */
.photo-corner-tl, .photo-corner-tr {
  position: absolute; top: 0;
  width: 22px; height: 22px;
  background: rgba(214,199,168,0.8);
  z-index: 2; pointer-events: none;
}
.photo-corner-tl { left: 0; clip-path: polygon(0 0,100% 0,0 100%); }
.photo-corner-tr { right: 0; clip-path: polygon(0 0,100% 0,100% 100%); }

/* Caption */
.photo-caption {
  padding: 5px 8px;
  font-size: 12px; font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: rgba(255,253,248,0.9);
  border-top: 1px solid rgba(0,0,0,0.06);
  text-align: center;
  min-height: 24px;
  word-break: break-word;
}

.photo-item.locked.selected .photo-wrap {
  outline: 2px dashed rgba(200,118,58,0.6);
  outline-offset: 2px;
}

/* Resize handle */
.resize-handle {
  position: absolute;
  bottom: -7px; right: -7px;
  width: 14px; height: 14px;
  background: white;
  border: 2px solid var(--accent);
  border-radius: 50%;
  cursor: se-resize;
  z-index: 10;
  box-shadow: 0 1px 5px rgba(0,0,0,0.25);
}

/* Rotate handle */
.rotate-handle {
  position: absolute;
  top: -32px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%;
  cursor: grab;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.rotate-handle:active { cursor: grabbing; }
.rotate-handle svg { width: 13px; height: 13px; fill: white; }

/* Selection ring */
.photo-item.selected .photo-wrap {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================
   RIGHT SIDE PANEL (Edit)
   ========================================= */
#side-panel {
  position: fixed;
  right: 0; top: 45px; bottom: 0;
  z-index: 900;
  width: var(--sidebar-w);
  background: rgba(255,253,248,0.97);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(.4,0,.2,1);
}
#side-panel.open { transform: translateX(0); }

#panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
#panel-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 16px; color: var(--text);
}
#close-panel {
  width: 28px; height: 28px;
  border-radius: 7px; border: 1px solid var(--border);
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 16px;
  transition: background 0.15s;
}
#close-panel:hover { background: #f0ebe0; }

#panel-body {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Section inside panel */
.sec-label {
  font-size: 10px; font-weight: 500;
  color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.prop-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.prop-row input[type=range] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}
.prop-val {
  font-size: 12px; font-weight: 500;
  color: var(--text);
  min-width: 36px; text-align: right;
}
.prop-icon { width: 14px; height: 14px; color: var(--text2); flex-shrink: 0; }

/* Grid buttons */
.btn-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.btn-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }

.opt-btn {
  padding: 7px 6px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 11px; font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.13s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opt-btn:hover { background: #f0ebe0; border-color: var(--accent); }
.opt-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.opt-btn.active-green { background: var(--accent2); color: white; border-color: var(--accent2); }

/* Color swatches */
.swatch-row { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s;
}
.swatch:hover { transform: scale(1.18); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px rgba(255,255,255,0.8); }

/* Action buttons */
.action-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 13px; font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  transition: all 0.15s;
}
.action-btn:hover { background: #f0ebe0; border-color: var(--accent); color: var(--accent); }
.action-btn.danger { color: #c0392b; }
.action-btn.danger:hover { background: #fdf0ee; border-color: #e74c3c; }
.action-btn svg { width: 14px; height: 14px; }

/* Panel text input */
.panel-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  background: transparent;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.panel-input:focus { border-color: var(--accent); }

/* =========================================
   BACKGROUND PANEL (popup from toolbar)
   ========================================= */
#bg-panel {
  position: fixed;
  left: 64px; top: 50%;
  transform: translateY(-50%) scale(0.95);
  z-index: 990;
  width: 260px;
  background: rgba(255,253,248,0.98);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 6px 0 28px rgba(0,0,0,0.13);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(.4,0,.2,1);
}
#bg-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(-50%) scale(1);
}
#bg-panel h3 {
  font-family: 'Playfair Display', serif;
  font-size: 15px; color: var(--text);
  margin-bottom: 12px;
}
.bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.bg-tmpl {
  aspect-ratio: 1;
  border-radius: 9px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  overflow: hidden;
  position: relative;
}
.bg-tmpl:hover { border-color: var(--accent); transform: scale(1.04); }
.bg-tmpl.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(200,118,58,0.3); }
.bg-tmpl span {
  position: absolute;
  bottom: 3px; left: 0; right: 0;
  font-size: 9px; font-weight: 600;
  text-align: center;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* =========================================
   CROP MODAL
   ========================================= */
#crop-modal {
  position: fixed; inset: 0;
  z-index: 5000;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
#crop-modal.open { display: flex; }

#crop-box {
  background: var(--panel);
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; gap: 14px;
}

#crop-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px; color: var(--text);
}

/* Aspect ratio buttons */
.ar-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ar-btn {
  padding: 5px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px; font-weight: 500;
  color: var(--text); cursor: pointer;
  transition: all 0.13s;
}
.ar-btn:hover { background: #f0ebe0; }
.ar-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Crop canvas container */
#crop-stage {
  position: relative;
  width: 100%;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  /* height set by JS based on AR */
  cursor: crosshair;
  touch-action: none;
}

/* The actual image inside crop stage */
#crop-img-el {
  position: absolute;
  top: 0; left: 0;
  transform-origin: top left;
  pointer-events: none;
  user-select: none;
  image-rendering: auto;
}

/* Crop overlay: dark mask + bright window */
#crop-overlay-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Crop frame (visible box the user moves) */
#crop-frame {
  position: absolute;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.48);
  cursor: move;
  box-sizing: border-box;
}
/* Corner handles on crop frame */
.crop-corner {
  position: absolute;
  width: 12px; height: 12px;
  background: white;
  border: 2px solid var(--accent);
  border-radius: 2px;
}
.crop-corner.tl { top: -6px; left: -6px; cursor: nw-resize; }
.crop-corner.tr { top: -6px; right: -6px; cursor: ne-resize; }
.crop-corner.bl { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-corner.br { bottom: -6px; right: -6px; cursor: se-resize; }

/* Crop rule of thirds lines */
#crop-frame::before, #crop-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 33%, rgba(255,255,255,0.15) 33%, rgba(255,255,255,0.15) 34%,
                    transparent 34%, transparent 66%, rgba(255,255,255,0.15) 66%, rgba(255,255,255,0.15) 67%, transparent 67%);
}
#crop-frame::after {
  background:
    linear-gradient(90deg, transparent 33%, rgba(255,255,255,0.15) 33%, rgba(255,255,255,0.15) 34%,
                    transparent 34%, transparent 66%, rgba(255,255,255,0.15) 66%, rgba(255,255,255,0.15) 67%, transparent 67%);
}

/* Crop controls below stage */
.crop-controls {
  display: flex; flex-direction: column; gap: 10px;
}
.crop-ctrl-row {
  display: flex; align-items: center; gap: 10px;
}
.crop-ctrl-row label {
  font-size: 12px; font-weight: 500;
  color: var(--text2);
  width: 56px; flex-shrink: 0;
}
.crop-ctrl-row input[type=range] {
  flex: 1; accent-color: var(--accent);
}
.crop-ctrl-row span {
  font-size: 12px; font-weight: 500;
  color: var(--text);
  min-width: 38px; text-align: right;
}

.crop-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}
.crop-actions button {
  padding: 9px 22px;
  border-radius: 9px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
#crop-cancel-btn {
  border: 1px solid var(--border);
  background: transparent; color: var(--text);
}
#crop-cancel-btn:hover { background: #f0ebe0; }
#crop-apply-btn {
  border: none;
  background: var(--accent); color: white;
}
#crop-apply-btn:hover { background: #a85e28; }

/* Reset button inside crop */
#crop-reset-btn {
  border: 1px solid var(--border);
  background: transparent; color: var(--text2);
  font-size: 12px; padding: 6px 14px;
  border-radius: 7px; cursor: pointer;
  transition: all 0.15s;
}
#crop-reset-btn:hover { background: #f0ebe0; }

/* =========================================
   EMPTY HINT
   ========================================= */
#empty-hint {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none; z-index: 1;
  transition: opacity 0.3s;
}
#empty-hint .big {
  font-family: 'Playfair Display', serif;
  font-size: 34px; color: rgba(180,165,130,0.55);
}
#empty-hint .small {
  font-size: 14px; color: rgba(122,110,95,0.45);
  margin-top: 10px;
}

/* =========================================
   NOTIFICATION TOAST
   ========================================= */
#notif {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9000;
  background: var(--text); color: white;
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 13px; font-weight: 500;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
#notif.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================
   HIDDEN FILE INPUTS
   ========================================= */
input[type=file] { display: none; }

/* =========================================
   LOADING OVERLAY
   ========================================= */
#loading-overlay {
  position: fixed; inset: 0;
  z-index: 9999;
  background: rgba(245,240,232,0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column;
}
#loading-overlay.show { display: flex; }

#loading-box {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: rgba(255,253,248,0.96);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 44px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
#loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-text {
  font-size: 14px; font-weight: 500;
  color: var(--text2);
  min-width: 200px; text-align: center;
  transition: all 0.2s;
}

/* Upload progress mini bar on photo */
.upload-progress-wrap {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 4px; background: rgba(0,0,0,0.15);
  border-radius: 0 0 4px 4px; overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}

/* =========================================
   SYNC STATUS BADGE
   ========================================= */
#sync-badge {
  position: fixed;
  bottom: 20px; left: 72px;
  z-index: 800;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,253,248,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}
#sync-badge.show { opacity: 1; }

#sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4a7c59;
  animation: pulse-dot 2s ease infinite;
}
#sync-dot.uploading { background: var(--accent); animation: none; }
#sync-dot.error     { background: #c0392b; animation: none; }

@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}


/* =========================================
   FLOATING TOUCH TOOLBAR (mobile)
   ========================================= */
#touch-toolbar {
  position: fixed;
  z-index: 3500;
  display: none;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,253,248,0.97);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 6px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  transition: opacity 0.15s, transform 0.15s;
}
#touch-toolbar.show { display: flex; }

.tt-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
  text-align: left;
}
.tt-btn:hover, .tt-btn:active { background: #f0ebe0; }
.tt-btn.danger { color: #c0392b; }
.tt-btn.danger:hover { background: #fdf0ee; }
.tt-btn svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75; }
.tt-sep { height: 1px; background: var(--border); margin: 2px 4px; }

