/* ── Design tokens (match FamilyHub) ─────────────────────── */
:root {
  --primary:   #2C3E6B;
  --accent:    #E8835A;
  --bg:        #F7F5F2;
  --surface:   #FFFFFF;
  --text:      #1E1E2E;
  --muted:     #6B7280;
  --border:    #E5E2DD;
  --success:   #4CAF82;
  --danger:    #E05555;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 2px 12px rgba(44,62,107,.08);
  --shadow-md: 0 4px 24px rgba(44,62,107,.13);
  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
  --trans:     0.16s ease;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Boot veil ────────────────────────────────────────────── */
.boot-veil {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 999; transition: opacity .25s ease;
}
.boot-veil.hidden { opacity: 0; pointer-events: none; }

/* ── Header ───────────────────────────────────────────────── */
.st-header {
  background: var(--primary); color: white;
  height: 58px; padding: 0 20px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.st-back {
  color: rgba(255,255,255,.7); text-decoration: none; font-size: 1.2rem;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all var(--trans);
  background: rgba(255,255,255,.1);
}
.st-back:hover { background: rgba(255,255,255,.2); color: white; }
.st-title {
  font-size: .95rem; font-weight: 700; letter-spacing: -.2px; flex: 1;
}
.st-title span { color: var(--accent); }
.st-user {
  font-size: .8rem; background: rgba(255,255,255,.15);
  border-radius: 20px; padding: 3px 12px; color: rgba(255,255,255,.85);
}

/* ── Main ─────────────────────────────────────────────────── */
.st-main {
  max-width: 960px; margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ── Storage bar ──────────────────────────────────────────── */
.st-storage-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  box-shadow: var(--shadow);
}
.st-storage-bar-wrap { flex: 1; }
.st-storage-bar {
  height: 6px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.st-storage-fill {
  height: 100%; border-radius: 99px; background: var(--success);
  transition: width .5s ease, background .4s ease;
  width: 0;
}
.st-storage-label { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* ── Upload zone ──────────────────────────────────────────── */
.st-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color var(--trans), background var(--trans);
  user-select: none;
}
.st-upload-zone:hover,
.st-upload-zone:focus,
.st-upload-zone.drag-over {
  border-color: var(--primary);
  background: #f0f3f9;
  outline: none;
}
.st-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.st-upload-text { font-size: .92rem; color: var(--text); }
.st-upload-link { color: var(--primary); text-decoration: underline; font-weight: 600; }
.st-upload-hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }

/* ── Upload progress ─────────────────────────────────────── */
.st-upload-progress {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
}
.st-upload-progress-bar {
  height: 5px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.st-upload-progress-fill {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .2s ease;
  width: 0;
}
.st-upload-progress-label { font-size: .82rem; color: var(--muted); }

/* ── Month groups ─────────────────────────────────────────── */
.st-month-group { display: flex; flex-direction: column; gap: 12px; }
.st-month-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/* ── Photo grid ───────────────────────────────────────────── */
.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}

.st-cell {
  position: relative; aspect-ratio: 1;
  border: none; background: var(--border); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; padding: 0;
  box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans);
}
.st-cell:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
  z-index: 1;
}
.st-cell:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

.st-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Video cell */
.st-cell-video video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.st-video-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3);
  transition: background var(--trans);
}
.st-cell-video:hover .st-video-overlay { background: rgba(0,0,0,.15); }
.st-video-play {
  font-size: 1.5rem; color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  background: rgba(0,0,0,.35); border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  padding-left: 3px;
}

/* ── Empty state ──────────────────────────────────────────── */
.st-empty {
  text-align: center; padding: 48px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.st-empty-icon { font-size: 3rem; opacity: .4; }
.st-empty-text { font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.st-empty-hint { font-size: .85rem; color: var(--muted); max-width: 280px; line-height: 1.5; }

/* ── Lightbox ─────────────────────────────────────────────── */
.st-lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(28, 30, 46, .93);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.st-lightbox[hidden] { display: none; }

.st-lb-close {
  position: absolute; top: 16px; right: 20px;
  background: rgba(255,255,255,.15); border: none; color: white;
  border-radius: 50%; width: 36px; height: 36px;
  font-size: 1rem; cursor: pointer;
  transition: background var(--trans);
  display: flex; align-items: center; justify-content: center;
}
.st-lb-close:hover { background: rgba(255,255,255,.25); }

.st-lb-media {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%; max-height: calc(100vh - 180px); overflow: hidden;
}
.st-lb-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.st-lb-video {
  max-width: 100%; max-height: 100%; border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.st-lb-info {
  width: 100%; max-width: 600px;
  padding: 14px 0 0;
  display: flex; flex-direction: column; gap: 8px;
}
.st-lb-name {
  font-size: .9rem; font-weight: 600; color: white;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.st-lb-date { font-size: .78rem; color: rgba(255,255,255,.55); }
.st-lb-notes {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm); padding: 8px 12px;
  color: white; font-size: .88rem; font-family: var(--font); width: 100%;
  outline: none; transition: border-color var(--trans);
}
.st-lb-notes::placeholder { color: rgba(255,255,255,.4); }
.st-lb-notes:focus { border-color: rgba(255,255,255,.5); }
.st-lb-actions { display: flex; gap: 10px; }
.st-lb-save, .st-lb-delete {
  border: none; border-radius: var(--radius-sm); padding: 8px 18px;
  font-size: .85rem; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: opacity var(--trans), background var(--trans);
}
.st-lb-save { background: var(--primary); color: white; }
.st-lb-save:hover { opacity: .85; }
.st-lb-delete { background: rgba(224,85,85,.2); color: #ff8080; border: 1px solid rgba(224,85,85,.35); }
.st-lb-delete:hover { background: rgba(224,85,85,.3); }

/* ── Toast ────────────────────────────────────────────────── */
.st-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--text); color: white;
  padding: 10px 20px; border-radius: 24px;
  font-size: .88rem; font-weight: 500; font-family: var(--font);
  box-shadow: var(--shadow-md);
  transition: transform .25s ease, opacity .25s ease;
  opacity: 0; pointer-events: none; white-space: nowrap; z-index: 300;
}
.st-toast.st-toast-error { background: var(--danger); }
.st-toast.st-toast-show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Filter bar ───────────────────────────────────────────── */
.st-filter-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.st-filter {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--muted);
  font: 600 .78rem var(--font); cursor: pointer; white-space: nowrap;
  transition: background var(--trans), border-color var(--trans), color var(--trans);
}
.st-filter:hover { border-color: var(--primary); color: var(--primary); }
.st-filter.active { background: var(--primary); border-color: var(--primary); color: white; }

.st-scan-btn {
  margin-left: auto;
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--accent);
  background: var(--surface); color: var(--accent);
  font: 600 .78rem var(--font); cursor: pointer; white-space: nowrap;
  transition: background var(--trans), color var(--trans);
}
.st-scan-btn:hover:not(:disabled) { background: var(--accent); color: white; }
.st-scan-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Face + geo badges ────────────────────────────────────── */
.st-face-badge, .st-geo-badge {
  position: absolute; bottom: 5px; left: 5px;
  background: rgba(28,30,46,.7);
  color: white; font-size: .7rem; font-weight: 600;
  border-radius: 10px; padding: 2px 6px;
  pointer-events: none; line-height: 1.4;
  backdrop-filter: blur(4px);
}
.st-geo-badge { left: auto; right: 5px; bottom: 5px; padding: 2px 4px; font-size: .8rem; }

/* ── Lightbox GPS link ─────────────────────────────────────── */
.st-lb-gps-link { color: #7eb8f7; text-decoration: none; }
.st-lb-gps-link:hover { text-decoration: underline; }

/* ── Map ──────────────────────────────────────────────────── */
#st-map-container {
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md);
}
#st-map { height: 480px; width: 100%; }
.st-map-hint {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 8px 14px; font-size: .78rem; color: var(--muted);
}
.st-map-empty {
  height: 200px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .9rem; padding: 20px; text-align: center;
  background: var(--surface);
}
.st-map-popup img.st-map-thumb {
  width: 150px; height: 100px; object-fit: cover;
  display: block; border-radius: 4px; margin-bottom: 6px;
}
.st-map-popup-name {
  font-size: .78rem; color: #333; margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px;
}
.st-map-popup button {
  font-size: .78rem; padding: 3px 10px; border-radius: 4px;
  background: var(--primary); color: white; border: none; cursor: pointer;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .st-main { padding: 16px 12px 60px; }
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 4px; }
  .st-upload-zone { padding: 20px 14px; }
  .st-header { padding: 0 14px; }
  .st-storage-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .st-storage-bar-wrap { width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   TAB BAR
══════════════════════════════════════════════════════════ */
.st-tabs {
  display: flex; gap: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0 20px;
  position: sticky; top: 58px; z-index: 90;
  box-shadow: 0 1px 4px rgba(44,62,107,.06);
}
.st-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 22px 11px;
  border: none; background: transparent;
  font: 600 .88rem var(--font); color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--trans), border-color var(--trans);
}
.st-tab:hover { color: var(--primary); }
.st-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.st-tab-icon { font-size: 1rem; }

/* ── Panels ───────────────────────────────────────────── */
.st-panel { display: none; }
.st-panel.active { display: block; animation: panelFadeIn .18s ease; }
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ══════════════════════════════════════════════════════════
   DOCUMENT WORKSPACE LAYOUT
══════════════════════════════════════════════════════════ */
.dc-layout {
  display: flex; min-height: calc(100vh - 118px);
}

/* ── Sidebar ──────────────────────────────────────────── */
.dc-sidebar {
  width: 220px; min-width: 180px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 0 20px;
  position: sticky; top: 118px; align-self: flex-start;
  height: calc(100vh - 118px); overflow-y: auto;
}
.dc-sidebar-header {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 16px 10px;
}
.dc-folder-list {
  list-style: none; flex: 1; overflow-y: auto;
}
.dc-folder-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; cursor: pointer;
  border-radius: 0; transition: background var(--trans);
  border-left: 3px solid transparent;
  font-size: .88rem; color: var(--text);
  position: relative;
}
.dc-folder-item:hover { background: rgba(44,62,107,.05); }
.dc-folder-item.active {
  background: rgba(44,62,107,.08);
  border-left-color: var(--primary);
  color: var(--primary); font-weight: 600;
}
.dc-folder-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.dc-folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-folder-count {
  font-size: .73rem; color: var(--muted);
  background: var(--border); border-radius: 20px;
  padding: 1px 7px; min-width: 22px; text-align: center;
}
.dc-folder-edit-btn {
  display: none; border: none; background: transparent;
  color: var(--muted); cursor: pointer; font-size: .85rem;
  padding: 0 2px; line-height: 1;
  flex-shrink: 0;
}
.dc-folder-item:hover .dc-folder-edit-btn { display: block; }

.dc-new-folder-btn {
  margin: 12px 12px 0;
  padding: 8px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: transparent; color: var(--muted);
  font: 600 .8rem var(--font); cursor: pointer;
  transition: border-color var(--trans), color var(--trans), background var(--trans);
  text-align: center;
}
.dc-new-folder-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(44,62,107,.04);
}

/* ── Main doc area ────────────────────────────────────── */
.dc-main {
  flex: 1; padding: 20px 24px 60px; overflow: hidden;
  display: flex; flex-direction: column; gap: 16px;
}

/* ── Toolbar ──────────────────────────────────────────── */
.dc-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.dc-toolbar-left { flex: 1; min-width: 160px; }
.dc-toolbar-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.dc-search-wrap { position: relative; }
.dc-search {
  width: 100%; padding: 8px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: .88rem var(--font); outline: none;
  transition: border-color var(--trans);
}
.dc-search:focus { border-color: var(--primary); }

/* ── Buttons ──────────────────────────────────────────── */
.dc-btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text);
  font: 600 .82rem var(--font); cursor: pointer;
  transition: background var(--trans), border-color var(--trans), color var(--trans);
  white-space: nowrap;
}
.dc-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(44,62,107,.04); }
.dc-btn-primary {
  background: var(--primary); color: white; border-color: var(--primary);
}
.dc-btn-primary:hover { background: #243258; border-color: #243258; color: white; }
.dc-btn-danger {
  background: transparent; color: var(--danger); border-color: rgba(224,85,85,.4);
}
.dc-btn-danger:hover { background: rgba(224,85,85,.08); }
.dc-btn-upload { position: relative; overflow: hidden; }

/* ── Upload progress (docs) ───────────────────────────── */
.dc-upload-progress {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.dc-upload-progress-bar {
  height: 4px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.dc-upload-progress-fill {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .2s ease; width: 0;
}
.dc-upload-progress-label { font-size: .8rem; color: var(--muted); }

/* ── Doc grid ─────────────────────────────────────────── */
.dc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  align-content: start;
}

.dc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
  display: flex; flex-direction: column; gap: 8px;
  animation: cardIn .2s ease;
  min-height: 130px;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.dc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(44,62,107,.2);
}
.dc-card:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

.dc-card-icon {
  font-size: 1.8rem; line-height: 1;
}
.dc-card-title {
  font-size: .9rem; font-weight: 700; color: var(--text);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-height: 1.35;
}
.dc-card-preview {
  font-size: .8rem; color: var(--muted); flex: 1;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-height: 1.45;
}
.dc-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .73rem; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 8px;
  margin-top: auto;
}
.dc-card-folder-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}

.dc-empty {
  text-align: center; padding: 60px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  grid-column: 1 / -1;
}
.dc-empty-icon { font-size: 3rem; opacity: .35; }
.dc-empty-title { font-size: 1rem; font-weight: 700; color: var(--muted); }
.dc-empty-hint { font-size: .85rem; color: var(--muted); max-width: 260px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════
   DOCUMENT EDITOR OVERLAY
══════════════════════════════════════════════════════════ */
.dc-editor-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(28,30,46,.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.dc-editor-overlay[hidden] { display: none; }

.dc-editor-sheet {
  width: 100%; max-width: 860px;
  height: 88vh;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -8px 40px rgba(44,62,107,.18);
  display: flex; flex-direction: column;
  animation: sheetUp .22s cubic-bezier(.16,1,.3,1);
}
@keyframes sheetUp {
  from { transform: translateY(100%); opacity: .6; }
  to   { transform: none; opacity: 1; }
}

.dc-editor-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dc-editor-title {
  flex: 1; border: none; outline: none;
  font: 700 1.1rem var(--font); color: var(--text);
  background: transparent; padding: 0;
  min-width: 0;
}
.dc-editor-title::placeholder { color: var(--border); font-weight: 400; }
.dc-editor-meta { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.dc-editor-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dc-editor-folder-select {
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text);
  font: .8rem var(--font); cursor: pointer; outline: none;
  max-width: 140px;
}
.dc-editor-folder-select:focus { border-color: var(--primary); }

.dc-editor-close {
  border: none; background: var(--border); color: var(--muted);
  border-radius: 50%; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; cursor: pointer;
  transition: background var(--trans), color var(--trans);
  flex-shrink: 0;
}
.dc-editor-close:hover { background: var(--danger); color: white; }

.dc-editor-body {
  flex: 1; resize: none; border: none; outline: none;
  padding: 20px 24px;
  font: 400 .95rem/1.7 var(--font); color: var(--text);
  background: transparent;
  overflow-y: auto;
}
.dc-editor-body::placeholder { color: var(--border); }

.dc-editor-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.dc-editor-status { font-size: .78rem; color: var(--muted); }

/* ══════════════════════════════════════════════════════════
   FOLDER MODAL
══════════════════════════════════════════════════════════ */
.dc-modal-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(28,30,46,.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.dc-modal-overlay[hidden] { display: none; }

.dc-modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px; width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: 10px;
  animation: modalPop .18s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalPop {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.dc-modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.dc-modal-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.dc-modal-input {
  padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  font: .9rem var(--font); color: var(--text); outline: none; width: 100%;
  transition: border-color var(--trans);
}
.dc-modal-input:focus { border-color: var(--primary); }
.dc-color-swatches {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0;
}
.dc-swatch {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform var(--trans), border-color var(--trans);
}
.dc-swatch:hover { transform: scale(1.15); }
.dc-swatch.selected { border-color: var(--text); transform: scale(1.1); }
.dc-modal-color-custom {
  width: 100%; height: 32px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; padding: 2px;
}
.dc-modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px;
}

/* ── Responsive adjustments ───────────────────────────── */
@media (max-width: 700px) {
  .dc-sidebar { display: none; }
  .dc-layout { flex-direction: column; }
  .dc-main { padding: 14px 12px 60px; }
  .dc-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dc-toolbar { flex-direction: column; align-items: stretch; }
  .dc-toolbar-right { justify-content: flex-end; }
  .dc-editor-sheet { height: 95vh; max-width: 100%; }
}
