:root {
  --bg: #0d0f15;
  --surface: #161923;
  --surface-2: #1e2230;
  --surface-3: #272c3e;
  --border: #2a3044;
  --text: #eef2ff;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-strong: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.18);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.16);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.18);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.16);
  --err: #ef4444;
  --err-soft: rgba(239, 68, 68, 0.16);
  --radius: 12px;
  --nav-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100%;
}

.hidden { display: none !important; }

/* Auth Gate */
.screen-center {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.auth-logo img { width: 36px; height: 36px; border-radius: 10px; }
.auth-logo h1 { margin: 0; font-size: 20px; }

/* Workspace Layout */
.workspace {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(13, 15, 21, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}

.top-bar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.top-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 12px calc(var(--nav-h) + 22px + env(safe-area-inset-bottom));
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(22, 25, 35, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.nav-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}

.nav-btn .nav-icon { font-size: 18px; line-height: 1; }
.nav-btn.active { color: #a5b4fc; }

/* Cards & Typography */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.card-title {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.muted { color: var(--muted); font-size: 12.5px; }
.err-text { color: #fca5a5; font-size: 12.5px; }
.warn-text { color: #fcd34d; font-size: 12.5px; }
.ok-text { color: #86efac; font-size: 12.5px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-3);
  color: #cbd5e1;
}

.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-err { background: var(--err-soft); color: var(--err); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Inputs & Controls */
label.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: #0f121b;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
  min-height: 40px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.field { margin-bottom: 10px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn:hover:not(:disabled) { background: var(--accent-strong); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-sec { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-sec:hover:not(:disabled) { background: var(--surface-3); }
.btn-warn { background: #b45309; }
.btn-warn:hover:not(:disabled) { background: #92400e; }
.btn-err { background: #b91c1c; }
.btn-err:hover:not(:disabled) { background: #991b1b; }
.btn-ok { background: #15803d; }
.btn-ok:hover:not(:disabled) { background: #166534; }
.btn-full { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Segmented Preset Tabs */
.seg-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.seg-tab {
  flex: 1;
  min-height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
}

.seg-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #e0e7ff;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Accordions */
details.accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12151f;
  margin-bottom: 10px;
  overflow: hidden;
}

details.accordion > summary {
  padding: 11px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: #dce4f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

details.accordion > summary::-webkit-details-marker { display: none; }
details.accordion > summary::after { content: "▾"; color: var(--muted); }
details.accordion[open] > summary::after { content: "▴"; }
details.accordion > .acc-body { padding: 4px 12px 12px 12px; }

/* Prompt Editor & Autocomplete */
.prompt-wrap { position: relative; margin-bottom: 10px; }

.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.prompt-tools { display: flex; gap: 5px; flex-wrap: wrap; }

.bracket-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

.bracket-ok { background: var(--ok-soft); color: var(--ok); }
.bracket-err { background: var(--err-soft); color: #fca5a5; }

.ac-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 25;
  margin-top: 4px;
  background: #141824;
  border: 1px solid var(--accent);
  border-radius: 10px;
  max-height: 230px;
  overflow-y: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

.ac-item {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(42, 48, 68, 0.5);
  color: var(--text);
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item:active { background: var(--surface-2); }

.tag-cat-0 { color: #93c5fd; }
.tag-cat-1 { color: #fca5a5; }
.tag-cat-3 { color: #d8b4fe; }
.tag-cat-4 { color: #86efac; }
.tag-cat-5 { color: #fdba74; }

.ac-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Chips & Presets */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.chip {
  background: var(--surface-2);
  color: #cbd5e1;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #e0e7ff;
}

/* Progress & Images */
.progress-track {
  width: 100%;
  height: 10px;
  background: #0d1018;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  transition: width 0.25s;
}

.preview-img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #090b10;
  display: block;
  margin-top: 8px;
}

/* Memory Gauges */
.gauge-box { margin-bottom: 10px; }
.gauge-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.gauge-bar { height: 8px; border-radius: 999px; background: #0d1018; overflow: hidden; border: 1px solid var(--border); }
.gauge-fill { height: 100%; background: var(--ok); transition: width 0.3s; }
.gauge-fill.high { background: var(--warn); }
.gauge-fill.crit { background: var(--err); }

/* Slide-Up Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.drawer-sheet {
  width: 100%;
  max-width: 760px;
  max-height: 84dvh;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.drawer-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drawer-body {
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
}

/* LoRA Grid */
.lora-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.lora-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  color: var(--text);
}

.lora-card:hover { border-color: var(--accent); }

.lora-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #0d1018;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
}

.lora-info {
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 600;
  word-break: break-all;
}

.wc-item {
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  margin-bottom: 8px;
  color: var(--text);
  cursor: pointer;
}

.wc-item:hover { border-color: var(--accent); }

/* Wake Steps */
.wake-steps {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wake-steps li {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
}

.wake-steps li.done { border-color: var(--ok); color: #bbf7d0; }
.wake-steps li.active { border-color: var(--warn); color: #fde68a; }

/* Toast */
.toast-host {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  background: #1f2433;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.toast.err { border-color: var(--err); color: #fecaca; }
.toast.ok { border-color: var(--ok); color: #bbf7d0; }

/* Slot Pills for ADetailer */
.slot-pills { display: flex; gap: 6px; margin-bottom: 10px; }
.slot-pill {
  flex: 1;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
}
.slot-pill.active { border-color: var(--accent); color: #fff; background: var(--accent-soft); }
.slot-pill.enabled::before { content: "● "; color: var(--ok); }

/* Job List */
.job-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Slider + Numeric Field (Tap-to-Unlock for Scroll Safety) */
.slider-field {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #11141e;
  border: 1px solid var(--border);
  border-radius: 9px;
  touch-action: pan-y;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.slider-field.is-unlocked {
  border-color: var(--accent);
  background: #15192a;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.slider-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.slider-head label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  margin: 0;
}

.slider-lock-pill {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
}

.slider-field.is-unlocked .slider-lock-pill {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #e0e7ff;
}

.slider-num {
  width: 68px !important;
  flex-shrink: 0;
  min-height: 30px !important;
  padding: 4px 6px !important;
  font-size: 13px !important;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.slider-track-wrap {
  padding: 4px 0;
}

input[type="range"].range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  outline: none;
  margin: 4px 0;
  touch-action: pan-y;
  transition: opacity 0.15s;
}

.slider-field.is-locked input[type="range"].range-slider {
  pointer-events: none;
  opacity: 0.55;
}

.slider-field.is-unlocked input[type="range"].range-slider {
  pointer-events: auto;
  opacity: 1;
  touch-action: none;
}

input[type="range"].range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #e0e7ff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.slider-field.is-locked input[type="range"].range-slider::-webkit-slider-thumb {
  background: #64748b;
  border-color: #94a3b8;
  box-shadow: none;
}

input[type="range"].range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #e0e7ff;
  cursor: pointer;
}

.slider-field.is-locked input[type="range"].range-slider::-moz-range-thumb {
  background: #64748b;
  border-color: #94a3b8;
}

/* Dimension 3-Group Sections */
.dim-section {
  margin-bottom: 8px;
}

.dim-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ac-tag-wc { color: #fde047; }
.ac-tag-lora { color: #f472b6; }

/* Phase 2B: Gallery, Explorer, Modals & PNG Info */
.gallery-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 150px;
}

.search-wrap input {
  padding-right: 30px;
  min-height: 36px;
  font-size: 13px;
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--surface-3);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.explorer-box {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.crumb-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 6px;
  cursor: pointer;
}

.crumb-btn:hover { background: var(--surface-2); color: var(--text); }
.crumb-btn.active { color: #a5b4fc; background: var(--accent-soft); }
.crumb-sep { color: #475569; font-size: 12px; }

.folder-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.folder-chip {
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.folder-chip:hover { border-color: var(--accent); background: var(--surface-3); }

.gallery-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px 2px;
}

.gallery-grid {
  display: grid;
  gap: 8px;
}

.gallery-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #0b0e16;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.gallery-card:hover { border-color: var(--accent); }

.gallery-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #0d1018;
}

.gallery-cap {
  padding: 5px 6px;
  background: rgba(15, 18, 27, 0.94);
  border-top: 1px solid rgba(42, 48, 68, 0.6);
}

.gallery-cap-name {
  font-size: 10.5px;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-cap-date {
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 1px;
}

.gallery-footer {
  margin-top: 12px;
}

/* Full-screen Image Detail Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.modal-dialog {
  width: 100%;
  max-width: 780px;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.modal-title-box {
  min-width: 0;
  flex: 1;
}

.modal-filename {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.modal-img-stage {
  background: #06080d;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.modal-img {
  width: 100%;
  max-height: 62dvh;
  object-fit: contain;
  display: block;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.modal-actions > .btn {
  flex: 1 1 auto;
}

.confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--err-soft);
  border: 1px solid var(--err);
  color: #fecaca;
  font-size: 12.5px;
  font-weight: 600;
}

.png-info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.kv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.kv-chip {
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 8px;
  color: #e2e8f0;
  word-break: break-all;
}

.kv-chip strong {
  color: #a5b4fc;
}

.png-text-block {
  margin-bottom: 10px;
}

.png-text-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.png-pre {
  margin: 0;
  padding: 9px 10px;
  background: #0d1018;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #dbeafe;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow-y: auto;
}

.copy-footer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Hybrid Folder Bar + Folder Explorer Bottom Sheet */
.hybrid-folder-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.folder-drawer-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.folder-drawer-btn:hover { background: var(--accent-strong); }

.hybrid-folder-row .folder-chips {
  flex: 1;
  min-width: 0;
}

.folder-chip-more {
  border-color: var(--accent);
  color: #a5b4fc;
  background: var(--accent-soft);
}

.folder-drawer-controls {
  padding: 10px 14px 8px 14px;
  border-bottom: 1px solid var(--border);
  background: #131622;
}

.drawer-month-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 10px 0 6px 2px;
}

.drawer-folder-grid {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.drawer-folder-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-folder-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.drawer-folder-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.drawer-folder-tile:hover { border-color: var(--accent); background: var(--surface-3); }

.drawer-folder-tile.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #e0e7ff;
}

.drawer-tile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-tile-meta {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
