:root {
  --bg: #09090b;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.18);
  --primary: #5e9eff;
  --primary-dim: rgba(94, 158, 255, 0.35);
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.5);
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --radius: 20px;
  --radius-sm: 12px;
  --blur: 24px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; outline: none; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 88% 120% at 50% 4%, rgba(30, 27, 75, 0.88) 0%, transparent 78%),
    radial-gradient(ellipse 58% 100% at 50% 18%, rgba(59, 130, 246, 0.14) 0%, transparent 75%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Üst ortadan mavi bulanık ışık */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(
    ellipse 68% 70% at 50% 42%,
    rgba(59, 130, 246, 0.07) 0%,
    rgba(30, 64, 175, 0.03) 45%,
    transparent 72%
  );
}

.bg-glow::before,
.bg-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.bg-glow::before {
  width: min(72vw, 560px);
  height: min(115vh, 820px);
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse 72% 130% at 50% 28%,
    rgba(94, 158, 255, 0.4) 0%,
    rgba(59, 130, 246, 0.22) 28%,
    rgba(59, 130, 246, 0.14) 42%,
    rgba(30, 64, 175, 0.08) 58%,
    rgba(30, 64, 175, 0.04) 72%,
    transparent 94%
  );
  filter: blur(72px);
  opacity: 0.92;
}

.bg-glow::after {
  width: min(48vw, 340px);
  height: min(75vh, 520px);
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse 68% 120% at 50% 35%,
    rgba(129, 140, 248, 0.22) 0%,
    rgba(94, 158, 255, 0.1) 38%,
    rgba(59, 130, 246, 0.06) 58%,
    rgba(30, 64, 175, 0.03) 72%,
    transparent 90%
  );
  filter: blur(64px);
  opacity: 0.8;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Liquid glass */
.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 var(--glass-highlight);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(94, 158, 255, 0.5), rgba(167, 139, 250, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.5px;
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-live {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--success);
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

/* Ana sayfa */
.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drop-zone {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 64px 32px;
  text-align: center;
  transition: border-color 0.25s, background 0.25s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(65vh, 520px);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: rgba(94, 158, 255, 0.55);
  background: rgba(94, 158, 255, 0.07);
}

.drop-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.drop-hint {
  margin: 0 0 22px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.drop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.preset-btn {
  padding: 8px 4px;
  font-size: 0.62rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.preset-btn:hover {
  border-color: var(--primary-dim);
  color: var(--text);
}

.preset-btn.active {
  border-color: var(--primary);
  background: rgba(94, 158, 255, 0.2);
  color: #fff;
}

.crop-hint-small {
  margin: 6px 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
}

#cropSelection.rounded-preview {
  border-radius: 8px;
  overflow: hidden;
}

.files-section {
  padding: 18px 20px;
}

.files-section[hidden] { display: none !important; }

.files-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.files-section-head h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.files-section-actions {
  display: flex;
  gap: 8px;
}

.file-item {
  cursor: default;
  transition: border-color 0.2s, background 0.2s;
}

.file-item.is-image {
  cursor: pointer;
}

.file-item.is-image:hover {
  border-color: var(--primary-dim);
  background: rgba(94, 158, 255, 0.08);
}

.file-item.active-edit {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-dim);
}

.status-badge.edited { color: var(--primary); background: rgba(94, 158, 255, 0.15); }

.panel { padding: 20px; }

.panel-title {
  margin: 0 0 18px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Controls */
.control-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.label-row label { margin: 0; }

.val { color: var(--primary); font-weight: 600; }

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  border-color: var(--primary-dim);
  box-shadow: 0 0 0 3px rgba(94, 158, 255, 0.15);
}

.row {
  display: flex;
  gap: 8px;
}

.row input { flex: 1; }

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 4px;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
}

.checkbox-wrap.compact { font-size: 0.75rem; }
.checkbox-wrap input { width: auto; accent-color: var(--primary); }

.image-settings { margin-top: 4px; }

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-small {
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: transform 0.15s, opacity 0.15s, background 0.2s;
}

.btn-primary {
  background: linear-gradient(180deg, rgba(94, 158, 255, 0.9), rgba(94, 158, 255, 0.65));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  font-size: 0.88rem;
  box-shadow: 0 4px 16px rgba(94, 158, 255, 0.25);
}

.btn-primary:hover { transform: translateY(-1px); opacity: 0.95; }

.btn-secondary {
  background: rgba(167, 139, 250, 0.25);
  color: #fff;
  border: 1px solid rgba(167, 139, 250, 0.35);
  padding: 8px 14px;
  font-size: 0.82rem;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  padding: 8px 14px;
  font-size: 0.82rem;
}

.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.btn-small {
  padding: 8px 10px;
  font-size: 0.75rem;
  background: rgba(94, 158, 255, 0.2);
  border: 1px solid rgba(94, 158, 255, 0.3);
  color: var(--text);
}

.btn-small.full { width: 100%; margin-top: 6px; }
.btn-small.muted { background: rgba(255, 255, 255, 0.06); border-color: var(--glass-border); }
.btn-small.accent { background: rgba(167, 139, 250, 0.25); border-color: rgba(167, 139, 250, 0.4); }

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

.drop-icon {
  margin: 0 auto 16px;
  color: var(--text-muted);
  opacity: 0.65;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.file-list:empty { display: none; }

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.file-info { flex: 1; min-width: 0; }

.file-name {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.status-badge.success { color: var(--success); background: rgba(52, 211, 153, 0.12); }
.status-badge.processing { color: var(--primary); background: rgba(94, 158, 255, 0.12); }
.status-badge.error { color: var(--danger); background: rgba(248, 113, 113, 0.12); }

.actions { display: flex; gap: 6px; flex-shrink: 0; }

.action-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.action-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.action-btn.download { color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.action-btn.process-single { color: var(--primary); border-color: var(--primary-dim); }

/* Footer — masaüstü: logo sol, linkler orta, telif sağ */
.footer {
  padding: 12px 22px 14px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 6;
}

.footer-logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 0;
  opacity: 0.95;
  transition: opacity 0.2s;
}

.footer-logo-link:hover { opacity: 1; }

.footer-logo {
  display: block;
  height: 38px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.footer-nav {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.footer-nav a:hover {
  color: var(--text);
  border-color: rgba(94, 158, 255, 0.35);
  background: rgba(94, 158, 255, 0.08);
  box-shadow: 0 0 20px rgba(94, 158, 255, 0.12);
}

.footer-copy {
  margin: 0 0 0 auto;
  margin-right: clamp(28px, 7vw, 88px);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.footer-copy a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-copy a:hover { color: var(--primary); }

/* Editor modal */
.editor-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.editor-modal.active { display: flex; }

.editor-container {
  width: 100%;
  max-width: 1020px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-header,
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  gap: 10px;
}

.btn-back {
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
}

.editor-footer {
  border-bottom: none;
  border-top: 1px solid var(--glass-border);
  gap: 10px;
}

.editor-footer[hidden] {
  display: none !important;
}

.editor-footer .btn-ghost,
.editor-footer .btn-primary { flex: 1; padding: 12px; }

.editor-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.editor-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  padding: 14px;
  overflow: auto;
  flex: 1;
}

.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 58vh;
  overflow-y: auto;
}

.editor-panel {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.editor-panel:last-child { border-bottom: none; }

.panel-heading {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.editor-body.crop-active .editor-sidebar {
  max-height: none;
}

.editor-body.crop-active #editorSettingsPanel,
.editor-body.crop-active #editorToolsPanel,
.editor-body.crop-mode #editorFilmstrip {
  display: none !important;
}

.editor-filmstrip {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--glass-border);
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.2);
}

.editor-filmstrip[hidden] { display: none !important; }

.filmstrip-item {
  flex-shrink: 0;
  width: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  transition: border-color 0.2s;
  font: inherit;
  color: inherit;
}

.filmstrip-item:hover { border-color: var(--primary-dim); }

.filmstrip-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-dim);
}

.filmstrip-item img,
.filmstrip-item .filmstrip-placeholder {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.filmstrip-item .saved-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  border: 1px solid #fff;
}

.btn-preview-toggle {
  display: none;
}

.editor-canvas-area {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 280px;
}

.canvas-viewport {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

#editorCanvas {
  max-width: 100%;
  max-height: 55vh;
  border-radius: 6px;
  display: block;
}

.editor-body.crop-active .editor-canvas-area {
  flex: 1;
}

.editor-body.crop-active {
  grid-template-columns: 1fr 260px;
}

/* Profesyonel kırpma overlay */
.crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.crop-overlay.active {
  pointer-events: auto;
}

.crop-shade {
  position: absolute;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: none;
}

.crop-selection {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 24px rgba(94, 158, 255, 0.35);
  cursor: move;
  pointer-events: auto;
  min-width: 24px;
  min-height: 24px;
}

.crop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.35) 1px, transparent 1px);
  background-size: 33.333% 100%, 100% 33.333%;
  pointer-events: none;
}

.crop-size-badge {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  pointer-events: auto;
  z-index: 2;
}

.crop-handle.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-handle.n { top: -6px; left: 50%; margin-left: -6px; cursor: ns-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-handle.e { top: 50%; right: -6px; margin-top: -6px; cursor: ew-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.crop-handle.s { bottom: -6px; left: 50%; margin-left: -6px; cursor: ns-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-handle.w { top: 50%; left: -6px; margin-top: -6px; cursor: ew-resize; }

.crop-tools-panel {
  border-left: 2px solid var(--primary-dim);
}

.crop-panel-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.crop-panel-hint {
  margin: 0 0 14px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.crop-dim-row {
  align-items: center;
}

.crop-dim-x {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.crop-action-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary.full { width: 100%; }

#cropToolsPanel[hidden],
#cropOverlay[hidden] {
  display: none !important;
}

#editorSettingsPanel[hidden],
#editorToolsPanel[hidden] {
  display: none !important;
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

#cropControls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

#cropControls[hidden] { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* ========== Mobil & tablet ========== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

@media (max-width: 900px) {
  .app {
    padding: 14px 14px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand h1 { font-size: 1.05rem; }

  .drop-zone {
    min-height: min(55vh, 460px);
    padding: 40px 20px;
  }

  .drop-title { font-size: 1.15rem; }

  .drop-actions {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  .drop-actions .btn-primary,
  .drop-actions .btn-secondary {
    width: 100%;
    min-height: 48px;
    font-size: 0.95rem;
  }

  .files-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .files-section-actions {
    width: 100%;
  }

  .files-section-actions .btn-primary,
  .files-section-actions .btn-ghost {
    flex: 1;
    min-height: 44px;
  }

  .file-item {
    flex-wrap: wrap;
    padding: 12px;
  }

  .file-info { min-width: calc(100% - 56px); }

  .actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
  }

  .action-btn {
    width: 40px;
    height: 40px;
  }

}

@media (max-width: 768px) {
  .editor-modal {
    padding: 0;
    align-items: stretch;
  }

  .editor-modal.active {
    display: flex;
  }

  .editor-container {
    max-width: none;
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .editor-header {
    flex-wrap: wrap;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .editor-header h2 {
    order: 3;
    width: 100%;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
  }

  .btn-back {
    font-size: 0.75rem !important;
    padding: 10px 12px !important;
  }

  .editor-body {
    grid-template-columns: 1fr;
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .editor-body.crop-active {
    grid-template-columns: 1fr;
  }

  .editor-canvas-area {
    min-height: auto;
    padding: 8px 10px 10px;
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    transition: min-height 0.25s ease;
  }

  .editor-canvas-area.preview-collapsed:not(.preview-expanded) {
    min-height: 0;
  }

  .editor-canvas-area.preview-collapsed:not(.preview-expanded) .canvas-viewport {
    max-height: min(28vh, 200px);
    max-height: min(28dvh, 200px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .editor-canvas-area.preview-collapsed:not(.preview-expanded) #editorCanvas {
    max-height: min(26vh, 188px);
    max-height: min(26dvh, 188px);
    width: auto;
    max-width: 100%;
  }

  .editor-canvas-area.preview-expanded .canvas-viewport {
    max-height: min(52vh, 420px);
    max-height: min(52dvh, 420px);
  }

  .editor-canvas-area.preview-expanded #editorCanvas {
    max-height: min(50vh, 400px);
    max-height: min(50dvh, 400px);
  }

  .editor-canvas-area.crop-mode-active .btn-preview-toggle {
    display: none !important;
  }

  .editor-canvas-area.crop-mode-active.preview-collapsed:not(.preview-expanded) .canvas-viewport,
  .editor-canvas-area.crop-mode-active.preview-collapsed:not(.preview-expanded) #editorCanvas {
    max-height: none;
  }

  .btn-preview-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(94, 158, 255, 0.12);
    border: 1px solid var(--primary-dim);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
  }

  .btn-preview-toggle:hover,
  .btn-preview-toggle:active {
    background: rgba(94, 158, 255, 0.2);
    border-color: var(--primary);
  }

  #editorCanvas {
    max-height: 42vh;
    max-height: 42dvh;
    transition: max-height 0.25s ease;
  }

  .editor-sidebar {
    max-height: none;
    order: 2;
  }

  .preset-grid {
    grid-template-columns: repeat(3, 1fr);
    max-height: 160px;
  }

  .preset-btn {
    min-height: 40px;
    font-size: 0.6rem;
    padding: 10px 4px;
  }

  .btn-small {
    min-height: 42px;
    font-size: 0.8rem;
  }

  input[type="text"],
  input[type="number"],
  select {
    min-height: 44px;
    font-size: 16px;
  }

  input[type="range"] {
    min-height: 28px;
  }

  .editor-footer {
    flex-direction: column;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  .editor-footer .btn-ghost,
  .editor-footer .btn-primary,
  .editor-footer .btn-secondary {
    width: 100%;
    min-height: 48px;
    flex: none;
  }

  .editor-filmstrip {
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .filmstrip-item {
    width: 56px;
  }

  .filmstrip-item img,
  .filmstrip-item .filmstrip-placeholder {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  .badge-live { font-size: 0.65rem; padding: 5px 10px; }

  .drop-zone { min-height: 48vh; padding: 32px 16px; }

  .drop-icon svg { width: 44px; height: 44px; }

  .drop-title { font-size: 1.05rem; }

  .drop-hint { font-size: 0.8rem; }

  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .button-group {
    grid-template-columns: 1fr;
  }
}

/* Footer — mobil: nav yan yana üstte, telif ortada, logo altta */
@media (max-width: 767px) {
  .footer {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 12px 16px;
    gap: 12px;
  }

  .footer-nav {
    order: 1;
    flex: none;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
  }

  .footer-nav a {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 5px;
    font-size: clamp(0.62rem, 2.8vw, 0.75rem);
    white-space: nowrap;
  }

  .footer-copy {
    order: 2;
    margin: 0;
    width: 100%;
    text-align: center;
    font-size: 0.72rem;
    white-space: normal;
  }

  .footer-logo-link {
    order: 3;
    width: auto;
    margin: 0;
    justify-content: center;
  }

  .footer-logo {
    height: 34px;
    max-width: 110px;
    object-position: center center;
    margin: 0 auto;
  }

  .legal-footer .footer-nav {
    order: 1;
  }

  .legal-footer .footer-copy {
    order: 2;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn-primary:active,
  .btn-secondary:active,
  .btn-ghost:active,
  .btn-small:active,
  .action-btn:active,
  .preset-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  .drop-zone:active {
    background: rgba(94, 158, 255, 0.1);
  }
}

/* SEO — arama motorları için görünür tanıtım metni */
.seo-intro {
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.seo-intro h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.seo-intro p {
  margin: 0 0 10px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.seo-intro ul {
  margin: 0 0 10px;
  padding-left: 1.2rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.seo-intro li + li {
  margin-top: 4px;
}

.seo-intro-more {
  margin-bottom: 0 !important;
  font-size: 0.8125rem !important;
}

.seo-intro a {
  color: var(--primary);
  text-decoration: none;
}

.seo-intro a:hover {
  text-decoration: underline;
}
