:root {
  --surface: #f8f9ff;
  --surface-low: #ffffff;
  --surface-panel: #F2EDED;
  --surface-soft: #F2EDED;
  --surface-soft-2: #F2EDED;
  --text: #0b1c30;
  --text-soft: #434654;
  --outline: #c3c5d7;
  --primary: #b0b0b0;
  --primary-strong: #909090;
  --accent: #ff8a00;
  --shadow: 0 18px 45px rgba(11, 28, 48, 0.08);
  --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --sidebar-width: 240px;
  --content-width: 100%;
  --font-display: "Inter", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 138, 0, 0.08), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, var(--surface) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
  background: #ffffff;
  border: 1px solid rgba(195, 197, 215, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 6px 18px;
}

.brand-mark {
  width: 100%;
  height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  display: block;
}

.brand-logo {
  width: 100%;
  height: auto;
  display: block;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent);
}

.brand-copy span {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.sidebar-nav,
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-footer {
  margin-top: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 0;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-item.secondary {
  min-height: 44px;
  font-size: 0.96rem;
  color: var(--text-soft);
}

.nav-item:hover {
  background: #F2EDED;
  color: var(--text);
}

.nav-item.active {
  background: #F2EDED;
  color: var(--text);
  font-weight: 700;
}



.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: inherit;
  font-size: 1.08rem;
  flex: 0 0 24px;
}

.nav-item.active .nav-icon {
  color: inherit;
}

.nav-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: #a0a4b8;
  margin: 10px 0 4px 12px;
  display: block;
}

.svg-icon {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
}

.nav-icon .svg-icon {
  width: 26px;
  height: 26px;
}

.primary-cta .svg-icon {
  fill: none;
  stroke: currentColor;
}

.workspace {
  min-width: 0;
  padding: 0 24px 32px 0;
  width: 100%;
}

.site-footer {
  max-width: var(--content-width);
  margin: 26px auto 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(195, 197, 215, 0.58);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.topbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-bottom: 6px;
}

.search-shell {
  position: relative;
  width: min(100%, 380px);
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 18px 0 50px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  outline: none;
}

.search-input::placeholder {
  color: rgba(67, 70, 84, 0.52);
}

.search-input:focus {
  border-color: rgba(176, 176, 176, 0.55);
  box-shadow: 0 0 0 4px rgba(176, 176, 176, 0.08), var(--shadow-soft);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(67, 70, 84, 0.8);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.lang-button {
  height: 46px;
  min-width: 46px;
  padding: 0 14px;
  border: 1px solid rgba(195, 197, 215, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.icon-button:hover,
.lang-button:hover {
  border-color: rgba(176, 176, 176, 0.35);
  box-shadow: 0 12px 20px rgba(11, 28, 48, 0.08);
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fefefe, #d8e4fb);
  border: 1px solid rgba(195, 197, 215, 0.9);
  box-shadow: var(--shadow-soft);
  font-weight: 700;
  color: var(--primary-strong);
}

.converter-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding-top: 18px;
}

.hero {
  padding: 0 0 4px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.2vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
  color: var(--text);
}

.hero-copy {
  max-width: 860px;
  margin: 12px 0 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.converter-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 24px;
  align-items: start;
}

.drop-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.drop-state {
  display: none;
  max-width: 640px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(176, 176, 176, 0.08);
  color: var(--text-soft);
  line-height: 1.45;
  font-size: 0.95rem;
}

body.replace-mode .drop-zone {
  min-height: 210px;
  padding: 16px 18px;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 247, 229, 0.95), rgba(255, 255, 255, 0.92));
}

body.replace-mode .drop-icon {
  width: 58px;
  height: 58px;
}

body.replace-mode .drop-svg {
  width: 22px;
  height: 22px;
}

body.replace-mode .drop-copy {
  gap: 8px;
}

body.replace-mode .drop-zone h2 {
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
}

body.replace-mode .drop-zone p {
  font-size: 0.93rem;
  line-height: 1.45;
}

body.replace-mode .drop-state {
  display: block;
  background: rgba(255, 138, 0, 0.16);
  border: 1px solid rgba(255, 138, 0, 0.22);
  color: var(--text);
  font-weight: 600;
}

body.replace-mode .primary-cta {
  min-height: 48px;
  padding: 0 22px;
}

.primary-stack,
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(195, 197, 215, 0.85);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(195, 197, 215, 0.5);
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-subtle {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.drop-zone {
  min-height: 420px;
  border: 2px dashed rgba(195, 197, 215, 0.9);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(242, 237, 237, 0.55), rgba(255, 255, 255, 0.85));
  padding: 22px 18px;
  text-align: center;
  display: grid;
  place-items: center;
  gap: 12px;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.drop-zone.dragover {
  border-color: rgba(176, 176, 176, 0.55);
  background: rgba(242, 237, 237, 0.7);
  transform: translateY(-2px);
}

.drop-icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--surface-soft-2);
}

.drop-svg {
  width: 28px;
  height: 28px;
}

.btn-icon,
.quick-link-icon {
  display: inline-grid;
  place-items: center;
}

.drop-zone h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  letter-spacing: 0;
}

.drop-zone p {
  margin: 0;
  max-width: 620px;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 1.04rem;
}

.primary-cta,
.primary-button {
  min-height: 56px;
  padding: 0 26px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff9d1f, var(--accent));
  color: #ffffff;
  font-weight: 700;
  box-shadow: none;
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-cta .btn-icon {
  width: 22px;
  height: 22px;
}

.primary-cta .svg-icon {
  width: 20px;
  height: 20px;
}

.primary-cta:hover,
.primary-button:hover {
  filter: brightness(1.02);
}

.primary-button:disabled,
.secondary-button:disabled,
.crop-controls button:disabled,
.action-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-button,
.crop-controls button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(195, 197, 215, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.secondary-button:hover,
.crop-controls button:hover {
  border-color: rgba(176, 176, 176, 0.35);
  transform: translateY(-1px);
}

.preview-panel {
  padding-bottom: 14px;
}

#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  align-items: start;
  min-height: 96px;
}

.image-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
  border: 1px solid rgba(195, 197, 215, 0.85);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.image-card * {
  box-sizing: border-box;
}

.image-card:hover {
  border-color: rgba(176, 176, 176, 0.35);
  box-shadow: 0 14px 26px rgba(11, 28, 48, 0.1);
  transform: translateY(-2px);
}

.image-card.selected {
  border-color: rgba(176, 176, 176, 0.72);
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 0 0 4px rgba(176, 176, 176, 0.1), var(--shadow-soft);
}

.selection-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(176, 176, 176, 0.65);
  background: rgba(255, 255, 255, 0.94);
  color: transparent;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(11, 28, 48, 0.12);
}

.image-card.selected .selection-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.image-card canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  border-radius: 14px;
  background: rgba(242, 237, 237, 0.7);
}

.meta {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.meta .filename {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 600;
}

.file-size-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.size-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.size-orig {
  background: rgba(0,0,0,0.06);
  color: var(--text-soft);
}

.download-result {
  display: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.4;
}

.download-result.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.download-result.warning {
  display: block;
  background: #fff8e1;
  color: #bf6000;
  border: 1px solid #ffcc80;
}

.name-edit {
  display: grid;
  gap: 8px;
}

.name-edit label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.name-edit .name-input,
.name-edit .alt-input,
.field select,
.card-controls input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(195, 197, 215, 0.95);
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.name-edit .name-input:focus,
.name-edit .alt-input:focus,
.field select:focus,
.card-controls input[type="number"]:focus {
  border-color: rgba(176, 176, 176, 0.55);
  box-shadow: 0 0 0 4px rgba(176, 176, 176, 0.08);
}

.card-controls {
  display: grid;
  gap: 12px;
}

.card-controls label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.card-controls input[type="range"] {
  width: 100%;
}

#settings {
  position: sticky;
  top: 18px;
}

.quick-links-panel {
  padding-bottom: 14px;
}

.quick-links {
  display: grid;
  gap: 10px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(195, 197, 215, 0.7);
  background: rgba(242, 237, 237, 0.75);
  color: var(--text);
}

.quick-link:hover {
  background: rgba(242, 237, 237, 0.9);
}

.quick-link-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.toggles {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(242, 237, 237, 0.82);
}

.mode-label {
  font-weight: 700;
  color: var(--text);
}

.mode-hint {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.inline-toggle,
.append-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(195, 197, 215, 0.8);
  background: rgba(242, 237, 237, 0.72);
}

.quality-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(195, 197, 215, 0.8);
  background: rgba(242, 237, 237, 0.72);
}

.quality-label {
  font-size: 0.95rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.quality-slider-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.quality-slider {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.quality-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  min-width: 34px;
  text-align: right;
}

body.append-mode .append-toggle {
  border-color: rgba(176, 176, 176, 0.4);
  background: rgba(176, 176, 176, 0.1);
  color: var(--text);
  box-shadow: 0 0 0 4px rgba(176, 176, 176, 0.06);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field span {
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preset-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.presets-details summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.presets-details summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(176, 176, 176, 0.08);
  color: var(--primary-strong);
  font-weight: 800;
  flex: 0 0 28px;
}

.presets-details[open] summary::after {
  content: "-";
}

.presets-details summary span:first-child {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preset-btn {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(195, 197, 215, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.preset-btn:hover {
  border-color: rgba(176, 176, 176, 0.35);
  transform: translateY(-1px);
}

.preset-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.action-buttons button {
  min-height: 42px;
}

.danger-button {
  border-color: rgba(255, 138, 0, 0.45);
  color: #a14f00;
  background: rgba(255, 138, 0, 0.1);
}

.secondary-actions {
  display: grid;
  gap: 10px;
}

.undo-hint {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(176, 176, 176, 0.08);
  color: var(--text-soft);
}

.tips-list {
  display: none;
}

.tips-list li {
  display: none;
}

.tips-list strong {
  display: none;
}

.tips-list span {
  display: none;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tip-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(242, 237, 237, 0.72);
}

.tip-card strong {
  font-size: 1rem;
}

.tip-card span {
  color: var(--text-soft);
  line-height: 1.35;
  font-size: 0.92rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 28, 48, 0.48);
  backdrop-filter: blur(8px);
  z-index: 10000;
  padding: 24px;
}

.modal.open {
  display: flex;
}

.modal-content {
  width: min(1100px, 100%);
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.modal-head {
  margin-bottom: 0;
}

.crop-image-container {
  min-height: 60vh;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(242, 237, 237, 0.92);
  border: 1px solid rgba(195, 197, 215, 0.85);
}

#crop-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
}

.crop-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hidden {
  display: none !important;
}

#spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 249, 255, 0.76);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 10001;
}

.spinner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 5px solid rgba(195, 197, 215, 0.5);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

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

#load-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  width: min(420px, calc(100vw - 40px));
  transform: translateX(-50%);
  height: 10px;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(195, 197, 215, 0.35);
  z-index: 10002;
}

#load-bar::-webkit-progress-bar {
  background: rgba(195, 197, 215, 0.35);
}

#load-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

#load-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }

  .workspace {
    padding: 16px;
    padding-top: 76px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    padding: 24px 20px;
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: 2px 0 24px rgba(11, 28, 48, 0.15);
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.menu-open {
    overflow: hidden;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 28, 48, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.menu-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(195, 197, 215, 0.5);
    z-index: 9999;
  }

  .mobile-brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: 10px;
    padding: 0;
  }

  .menu-toggle:hover {
    background: rgba(195, 197, 215, 0.2);
  }

  .converter-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #settings {
    position: static;
  }
}

@media (min-width: 1101px) {
  .mobile-header,
  .sidebar-overlay {
    display: none !important;
  }
}

@media (max-width: 860px) {
  .topbar,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .drop-zone {
    min-height: 360px;
    padding: 28px 18px;
  }

  body.has-images .drop-zone {
    min-height: 240px;
    padding: 16px 14px;
  }

  body.replace-mode .drop-zone {
    min-height: 190px;
    padding: 14px 14px;
  }

  .crop-controls {
    flex-direction: column;
  }

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

  .quick-links {
    gap: 8px;
  }

  .drop-state {
    font-size: 0.9rem;
  }
}
