/* ==========================================================================
   Nodeimage / ImgDrop Precision Design System (1:1 Match)
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Colors - Dark Canvas Grid Background */
  --bg-canvas: #4b4e54;
  --grid-line: rgba(22, 24, 28, 0.48);
  --header: #1e1f23;
  --panel: #25262a;
  --panel-dark: #18191c;
  --panel-input: #1b1c20;
  --border-card: rgba(255, 255, 255, 0.06);
  --border-input: #33353c;

  --text: #ffffff;
  --muted: #9fa4b2;
  --muted-dark: #7e8492;
  --accent: #38bdf8;
  --accent-gold: #f1c40f;

  --danger: #f43f5e;
  --shadow: rgba(0, 0, 0, 0.45);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #e2e5ec;
  --grid-line: rgba(0, 0, 0, 0.08);
  --header: #ffffff;
  --panel: #ffffff;
  --panel-dark: #f1f3f7;
  --panel-input: #f8fafc;
  --border-card: #d8dde6;
  --border-input: #cbd5e1;

  --text: #1e242d;
  --muted: #64748b;
  --muted-dark: #94a3b8;
  --accent: #0284c7;
  --accent-gold: #eab308;
  --shadow: rgba(0, 0, 0, 0.12);
}

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

html {
  min-width: 320px;
  background-color: var(--bg-canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background-color: var(--bg-canvas);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  position: relative;
}

.ambient {
  display: none !important;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.hidden {
  display: none !important;
}

/* Auth Loading */
.auth-checking #loginView,
.auth-checking #appView {
  visibility: hidden;
}

.auth-loading {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  background-color: var(--bg-canvas);
  font-size: 14px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

body:not(.auth-checking) .auth-loading {
  display: none;
}

/* Common Card */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 30px var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.error {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.error:empty, .status:empty {
  display: none;
}

.status {
  margin: 14px 0 0;
  padding: 8px 16px;
  color: var(--muted);
  background: var(--panel-dark);
  border-radius: var(--radius-md);
  font-size: 13px;
  text-align: center;
}

/* Buttons */
.button, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 16px;
  color: var(--text);
  background: #32343a;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

.button:hover:not(:disabled) {
  background: #3e4149;
}

.button.primary {
  color: #111111;
  background: var(--accent-gold);
  font-weight: 700;
  border-color: transparent;
}

.button.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.button.danger {
  color: #ffffff;
  background: var(--danger);
}

.button.full {
  width: 100%;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.15s ease;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

/* Form */
.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.form-stack label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--panel-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
}

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

/* Login */
.login-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 380px);
  padding: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--accent-gold);
  border-radius: 10px;
}

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

.login-card h1 {
  margin: 4px 0 6px;
  font-size: 24px;
  font-weight: 800;
}

/* ==========================================================================
   Header / Topbar (Exact NodeSeek Match)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 54px;
  background: var(--header);
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), 1160px);
  min-height: 54px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  color: var(--text);
}

.brand-text strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-right: 6px;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  font-weight: 600;
}

.usage-mini {
  color: var(--muted);
  font-size: 12px;
}

.account-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  list-style: none;
  cursor: pointer;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-popover {
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px var(--shadow);
}

.popover-divider {
  height: 1px;
  background: var(--border-card);
  margin: 4px 0;
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

.popover-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.popover-item.danger-text {
  color: var(--danger);
}

/* ==========================================================================
   Upload Hero Card (1:1 NodeSeek Match)
   ========================================================================== */
.content {
  width: min(calc(100% - 48px), 1160px);
  margin: 0 auto;
  padding: 36px 0 60px;
}

.upload-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  padding: 46px 32px 40px;
  text-align: center;
}

.card-gear-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  color: #8a8f9d;
  width: 32px;
  height: 32px;
}

.card-gear-btn:hover {
  color: #ffffff;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  outline: none;
  cursor: pointer;
}

.folder-icon-3d {
  width: 108px;
  height: 76px;
  margin-bottom: 18px;
  transition: transform 0.2s ease;
}

.drop-zone:hover .folder-icon-3d {
  transform: scale(1.04) translateY(-2px);
}

.drop-zone h2 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.drop-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: #9fa4b2;
}

.drop-paste-hint {
  margin: 0;
  font-size: 13px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.kbd-badge {
  display: inline-block;
  padding: 2px 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  background: #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  margin: 0 3px;
}

/* ==========================================================================
   Result Cards (Exact 1:1 NodeSeek Match)
   ========================================================================== */
.result-section {
  margin-top: 24px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.result-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease;
}

.result-card:hover {
  transform: translateY(-2px);
}

.card-thumb-wrap {
  width: 100%;
  height: 140px;
  background: var(--panel-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.card-thumb-wrap:hover .card-thumb {
  transform: scale(1.05);
}

.card-body {
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-filename {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta-text {
  font-size: 11px;
  color: #8c919e;
  margin-bottom: 8px;
}

.card-copy-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: #cbd5e1;
  background: var(--panel-dark);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 11px;
  line-height: 32px;
  cursor: pointer;
  white-space: nowrap;
  overflow-x: auto;
  text-overflow: clip;
  transition: all 0.15s ease;
}

.card-copy-input:hover,
.card-copy-input:focus {
  color: #ffffff;
  border-color: #4b5160;
  outline: none;
}

.card-format-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 3px 6px;
  background: var(--panel-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 4px;
}

.card-fmt-btn {
  flex: 1;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: #828795;
  background: transparent;
  transition: all 0.15s ease;
}

.card-fmt-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.card-fmt-btn.active {
  color: #111111;
  background: var(--accent-gold);
  font-weight: 800;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(241, 196, 15, 0.35);
}

/* Processing & Settings */
.settings-panel {
  margin-top: 24px;
  padding: 24px;
}

.settings-panel .card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.settings-panel .card-heading h2 {
  font-size: 20px;
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.setting-group {
  min-width: 0;
  margin: 0;
  padding: 16px;
  background: var(--panel-dark);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
}

.setting-group legend {
  padding: 0 6px;
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.setting-group > * + * {
  margin-top: 12px;
}

.setting-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  min-width: 36px;
  height: 20px;
  margin-top: 2px;
  background: #383a42;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-row input[type="checkbox"]:checked {
  background: var(--accent-gold);
}

.toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}

.toggle-row strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.toggle-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.setting-note {
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.check-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.retention-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 0.5fr);
  align-items: start;
  gap: 12px;
}

.settings-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

/* History / Gallery View */
#historyView {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.folder-section {
  padding: 20px 24px;
  margin-bottom: 20px;
}

.folder-section .section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.folder-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-header-left h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-badge {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-dark);
  border-radius: 9999px;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  width: 100%;
}

.folder-card {
  position: relative;
  background: var(--panel-dark);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.folder-card:hover {
  background: #2a2b30;
}

.folder-main {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 32px 10px 10px;
  color: var(--text);
  text-align: left;
}

.folder-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 16px;
  background: rgba(241, 196, 15, 0.15);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.folder-card-text strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-card-text small {
  color: var(--muted);
  font-size: 11px;
}

.folder-menu {
  position: absolute;
  top: 8px;
  right: 6px;
}

.folder-menu summary {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  list-style: none;
  cursor: pointer;
}

.folder-menu summary::-webkit-details-marker {
  display: none;
}

.folder-menu-popover {
  position: absolute;
  right: 0;
  top: 26px;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 110px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 20px var(--shadow);
}

.menu-button {
  width: 100%;
  padding: 6px 8px;
  color: var(--text);
  text-align: left;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.menu-button:hover {
  background: var(--panel-dark);
}

.menu-button.danger-text {
  color: var(--danger);
}

.history-card {
  padding: 20px 24px;
}

.history-area-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.history-area-heading h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 16px;
  background: var(--panel-dark);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.history-item {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 18px var(--shadow);
}

.history-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-gold);
}

.history-item > .thumb {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--panel-dark);
  cursor: pointer;
}

.history-body {
  padding: 10px 12px 6px;
}

.item-meta {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-value {
  display: block;
  width: 100%;
  height: 32px;
  line-height: 30px;
  padding: 0 8px;
  color: #cbd5e1;
  background: var(--panel-dark);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  overflow-x: auto;
  text-overflow: clip;
  cursor: pointer;
}

.copy-value:hover {
  color: #ffffff;
  border-color: #4b5160;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 8px 8px;
}

.history-actions .small-button {
  flex: 1;
  min-height: 26px;
  padding: 2px 4px;
  color: var(--muted);
  background: var(--panel-dark);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.history-actions .small-button.active {
  color: #111;
  background: var(--accent-gold);
}

.history-actions .more-menu {
  position: relative;
}

.history-actions .more-menu summary {
  padding: 4px 6px;
  color: var(--muted);
  background: var(--panel-dark);
  border-radius: var(--radius-sm);
  font-size: 11px;
  list-style: none;
  cursor: pointer;
}

.history-actions .more-menu summary::-webkit-details-marker {
  display: none;
}

.more-popover {
  position: absolute;
  bottom: 28px;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 110px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 20px var(--shadow);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.pagination span {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--panel-dark);
  border-radius: var(--radius-lg);
  font-size: 13px;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.75);
}

.modal-card {
  width: min(100%, 460px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px var(--shadow);
}

.modal-card .card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-card hr {
  margin: 18px 0;
  border: none;
  border-top: 1px solid var(--border-card);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.confirm-card {
  width: min(100%, 360px);
  text-align: center;
  padding: 24px;
}

.confirm-icon-danger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  color: var(--danger);
  background: rgba(244, 63, 94, 0.15);
  border-radius: 50%;
}

.preview-card {
  width: min(100%, 800px);
  padding: 20px;
}

.preview-img-container {
  display: grid;
  place-items: center;
  min-height: 240px;
  max-height: 65vh;
  margin: 12px 0;
  background: var(--panel-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preview-image {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.folder-choices {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  max-height: 240px;
  overflow-y: auto;
}

.folder-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel-dark);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.folder-choice:has(input:checked) {
  background: rgba(241, 196, 15, 0.15);
  border-color: var(--accent-gold);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  max-width: min(360px, calc(100% - 48px));
  padding: 8px 16px;
  color: #ffffff;
  background: #1e1f23;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .result-grid,
  .history-grid,
  .folder-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .topbar-inner {
    width: calc(100% - 24px);
  }

  .content {
    width: calc(100% - 24px);
    padding: 20px 0 40px;
  }

  .upload-card {
    padding: 30px 16px 24px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .retention-row {
    grid-template-columns: 1fr;
  }

  .result-grid,
  .history-grid,
  .folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .result-grid,
  .history-grid,
  .folder-grid {
    grid-template-columns: 1fr;
  }
}


