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

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

:root {
  --top-nav-height: 72px;
  --top-nav-visual-offset: 0px;
  --bottom-menu-height: 60px;
  --bottom-menu-safe-inset: env(safe-area-inset-bottom, 0px);
  --bottom-menu-visual-offset: 0px;
  --bg-app: #17191d;
  --bg-shell: #1d2025;
  --bg-surface: #25292f;
  --bg-elevated: #2e333b;
  --bg-control: #383e47;
  --bg-control-hover: #444b55;
  --border-strong: #464b52;
  --border-subtle: rgba(239, 232, 214, 0.12);
  --text-primary: #f2ede1;
  --text-muted: #c5beac;
  --text-dim: #9f9788;
  --accent: #d7aa52;
  --accent-hover: #e3bd72;
  --accent-soft: rgba(215, 170, 82, 0.16);
  --accent-strong: #ba8733;
  --success: #97ad77;
  --success-hover: #a7bc88;
  --warning: #c9722d;
  --danger: #c85442;
  --danger-hover: #d86552;
}

html.standalone-mode {
  --top-nav-visual-offset: 100px;
  --bottom-menu-safe-inset: 0px;
  --bottom-menu-visual-offset: 50px;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

.container {
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
  min-height: -webkit-fill-available;
}

.sidebar-menu {
  position: fixed;
  top: var(--top-nav-visual-offset);
  left: 0;
  right: 0;
  width: 100%;
  height: var(--top-nav-height);
  background: var(--bg-shell);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 15px;
  z-index: 200;
  border-bottom: 1px solid var(--border-strong);
  touch-action: manipulation;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-menu::-webkit-scrollbar {
  display: none;
}

.menu-icon {
  width: 48px;
  height: 44px;
  background: var(--bg-surface);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.menu-icon:hover {
  background: var(--bg-control);
  color: var(--accent);
  transform: scale(1.1);
}

.menu-icon.active {
  background: var(--accent);
  color: #1a1712;
}

.menu-icon.mode-active,
.bottom-menu-button.mode-active {
  background: var(--accent);
  color: #1a1712;
}

.sliding-panel {
  position: fixed;
  top: calc(var(--top-nav-height) + var(--top-nav-visual-offset));
  bottom: calc(var(--bottom-menu-height) + var(--bottom-menu-safe-inset) + var(--bottom-menu-visual-offset));
  left: 0;
  right: 0;
  width: auto;
  background: rgba(37, 41, 47, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 18px 18px 80px 18px;
  overflow-y: auto;
  z-index: 401;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
  touch-action: pan-y;
}

.sliding-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.panel-modal-backdrop {
  display: none;
  position: fixed;
  inset: calc(var(--top-nav-height) + var(--top-nav-visual-offset)) 0 calc(var(--bottom-menu-height) + var(--bottom-menu-safe-inset) + var(--bottom-menu-visual-offset)) 0;
  background: rgba(9, 10, 12, 0.3);
  z-index: 400;
}

.panel-modal-backdrop.open {
  display: block;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: -18px -18px 20px -18px;
  padding: 18px 18px 15px 18px;
  border-bottom: 1px solid var(--border-strong);
  position: sticky;
  top: -18px;
  z-index: 2;
  background: rgba(37, 41, 47, 0.97);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.panel-title {
  color: var(--accent);
  font-size: 18px;
  font-weight: bold;
  padding-right: 42px;
}

.close-panel {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 52px;
  height: 52px;
  padding: 8px;
  border-radius: 10px;
  transition: all 0.3s ease;
  position: absolute;
  top: 0;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-panel svg {
  width: 40px !important;
  height: 40px !important;
  stroke-width: 2.5;
}

.close-panel:hover {
  background: var(--bg-control);
  color: var(--accent);
}

.bottom-menu {
  position: fixed;
  bottom: var(--bottom-menu-visual-offset);
  left: 0;
  right: 0;
  height: calc(var(--bottom-menu-height) + var(--bottom-menu-safe-inset));
  background: var(--bg-shell);
  border-top: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  padding: 0 20px var(--bottom-menu-safe-inset) 20px;
  z-index: 250;
  touch-action: manipulation;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bottom-menu::-webkit-scrollbar {
  display: none;
}

.bottom-menu-logo {
  margin-left: 4px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
}

.bottom-menu-logo-image {
  display: block;
  height: 60px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.bottom-menu-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: none;
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  flex: none;
  width: auto;
  max-width: 150px;
  flex-shrink: 0;
}

/* Fixed widths for toggle buttons to prevent shifting */
#bottomPlayStopBtn {
  width: 110px;
  justify-content: center;
}

#bottomRecordStopBtn {
  width: 120px;
  justify-content: center;
}

.bottom-menu-button:hover {
  background: var(--bg-control);
  transform: translateY(-1px);
}

.bottom-menu-button.primary {
  background: var(--accent);
  color: #1a1712;
}

.bottom-menu-button.primary:hover {
  background: var(--accent-hover);
}

.bottom-menu-button.secondary {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(215, 170, 82, 0.34);
}

.bottom-menu-button.secondary:hover {
  background: rgba(215, 170, 82, 0.24);
}

.bottom-menu-button.danger {
  background: var(--danger);
}

.bottom-menu-button.danger:hover {
  background: var(--danger-hover);
}

.bottom-menu-button.is-recording {
  background: rgba(200, 84, 66, 0.18);
  border: 2px solid var(--danger);
  color: #f4ded8;
  box-shadow: 0 0 0 1px rgba(200, 84, 66, 0.16), 0 0 18px rgba(200, 84, 66, 0.18);
  animation: recording-button-pulse 1.2s ease-in-out infinite;
}

.bottom-menu-button.is-recording:hover {
  background: rgba(200, 84, 66, 0.24);
}

.bottom-menu-button.success {
  background: var(--accent);
  color: #1a1712;
}

.bottom-menu-button.success:hover {
  background: var(--accent-hover);
}

.bottom-menu-button:disabled {
  background: #555b64;
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
}

.bottom-menu-button:disabled:hover {
  background: #555b64;
  transform: none;
}

.export-modal.hidden {
  display: none;
}

.export-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.export-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.export-modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.export-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
}

.export-modal-close:hover {
  background: var(--bg-control);
}

.export-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.export-modal-copy {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 18px;
}

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

.export-action-button {
  width: 100%;
  justify-content: center;
}


.canvas-container {
  position: relative;
  background: white;
  overflow: hidden;
  margin-left: 0;
  margin-top: calc(var(--top-nav-height) + var(--top-nav-visual-offset));
  margin-bottom: calc(var(--bottom-menu-height) + var(--bottom-menu-safe-inset) + var(--bottom-menu-visual-offset));
  height: calc(100dvh - var(--top-nav-height) - var(--top-nav-visual-offset) - var(--bottom-menu-height) - var(--bottom-menu-safe-inset) - var(--bottom-menu-visual-offset));
}

.image-adjust-drawer {
  position: fixed;
  top: 84px;
  left: 16px;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  background: rgba(37, 41, 47, 0.94);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  z-index: 450;
}

.image-upload-drawer {
  position: fixed;
  top: 84px;
  left: 16px;
  width: min(220px, calc(100vw - 32px));
  padding: 10px;
  background: rgba(37, 41, 47, 0.94);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  z-index: 450;
}

.image-upload-drawer.hidden {
  display: none;
}

.image-adjust-drawer.hidden {
  display: none;
}

.image-adjust-option {
  padding: 10px 8px;
  background: var(--bg-control);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.image-adjust-option:hover {
  background: var(--bg-control-hover);
}

.image-adjust-option.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1712;
}

#backgroundImage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: filter 0.3s ease, transform 0.3s ease;
  display: block;
  transform-origin: center center;
}

#drawingCanvas {
  cursor: crosshair;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}

.section {
  margin-bottom: 25px;
  padding: 15px;
  background: var(--bg-elevated);
  border-radius: 8px;
}

.section h3 {
  margin-bottom: 10px;
  color: var(--accent);
}

.about-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.about-logo-image {
  display: block;
  width: auto;
  height: 84px;
  max-width: min(260px, 100%);
  object-fit: contain;
}

.color-picker {
  width: 200px;
  height: 150px;
  background: linear-gradient(
    to right,
    #ff0000 0%,
    #ffff00 17%,
    #00ff00 33%,
    #00ffff 50%,
    #0000ff 67%,
    #ff00ff 83%,
    #ff0000 100%
  );
  position: relative;
  border-radius: 4px;
  cursor: crosshair;
  margin-bottom: 10px;
  border: 2px solid var(--border-strong);
  user-select: none;
}

.color-picker::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 1) 100%
  );
  pointer-events: none;
  border-radius: 2px;
}

.color-picker-cursor {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 3px rgba(0,0,0,0.5), inset 0 0 3px rgba(0,0,0,0.5);
  z-index: 10;
}

.color-preview {
  width: 40px;
  height: 40px;
  border: 2px solid white;
  border-radius: 4px;
  margin-bottom: 10px;
}

.slider-container {
  margin: 10px 0;
}

.slider-container label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

input[type="range"] {
  width: 100%;
  margin-bottom: 5px;
}

input[type="text"] {
  width: 100%;
  padding: 8px;
  background: var(--bg-control);
  border: none;
  border-radius: 4px;
  color: white;
  margin-bottom: 10px;
}

select {
  width: 100%;
  padding: 8px;
  background: var(--bg-control);
  border: none;
  border-radius: 4px;
  color: white;
  margin-bottom: 10px;
}

.effects-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.effects-grid.multi-fx-enabled {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(215, 170, 82, 0.28);
}

.effect-btn {
  min-height: 68px;
  padding: 10px 6px;
  background: var(--bg-control);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.effect-btn:hover {
  background: var(--bg-control-hover);
}

.effect-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #1a1712;
}

.effect-btn.sequencer-active {
  border-color: var(--success);
  background: rgba(151, 173, 119, 0.24);
  color: var(--text-primary);
}

.effect-btn.sequencer-current {
  border-color: var(--accent-hover);
  background: #efe3b3;
  color: #302816;
  box-shadow: 0 0 15px rgba(215, 170, 82, 0.38);
  animation: pulse-border 0.3s ease;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 5px rgba(215, 170, 82, 0.24); }
  50% { box-shadow: 0 0 20px rgba(215, 170, 82, 0.55); }
  100% { box-shadow: 0 0 15px rgba(215, 170, 82, 0.38); }
}

.music-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.image-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-image-controls {
  gap: 6px;
}

.compact-image-controls .file-input {
  margin-bottom: 4px;
}

.compact-image-controls .image-info {
  margin: 4px 0;
  padding: 8px 10px;
}

.compact-image-controls .slider-container {
  margin: 4px 0;
}

.compact-image-controls .slider-container label {
  margin-bottom: 3px;
}

.compact-image-controls .play-controls {
  gap: 8px;
  margin-top: 2px;
}

.image-help-box {
  margin-bottom: 6px !important;
}

.file-input {
  margin-bottom: 10px;
}

.image-upload-button {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-control);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.image-upload-button:hover {
  background: var(--bg-control-hover);
}

input[type="file"] {
  width: 100%;
  padding: 8px;
  background: var(--bg-control);
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
}

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

button {
  flex: 1;
  padding: 10px;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  color: #1a1712;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  background: #555b64;
  color: var(--text-dim);
  cursor: not-allowed;
}

.image-button {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(215, 170, 82, 0.34);
}

.image-button:hover {
  background: rgba(215, 170, 82, 0.24);
}

.text-path-active {
  background: var(--accent) !important;
  color: #1a1712 !important;
}

.bpm-display {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: var(--accent);
  margin: 10px 0;
}

.manual-speed-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.manual-speed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.manual-speed-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.manual-speed-input {
  width: 72px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  text-align: center;
}

.manual-speed-slider {
  width: 100%;
  margin: 0;
}

.manual-speed-input:disabled,
.manual-speed-slider:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sequencer-controls {
  margin-bottom: 15px;
  padding: 10px;
  background: var(--bg-control);
  border-radius: 6px;
}

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

.sequencer-settings {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sequencer-settings label {
  font-size: 12px;
  color: var(--text-muted);
}

.sequencer-settings select {
  padding: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}

.sequencer-status {
  font-size: 11px;
  margin-left: 5px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  transform: scale(1.2);
}

.checkbox-label span {
  font-weight: bold;
  color: var(--accent);
}

.audio-info, .image-info {
  margin: 10px 0;
  padding: 10px;
  background: var(--bg-control);
  border-radius: 4px;
  font-size: 12px;
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

.status-indicator.loading {
  background: var(--warning);
  animation: pulse 1s infinite;
}

.status-indicator.ready {
  background: var(--success);
}

.status-indicator.error {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes recording-button-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(200, 84, 66, 0.16), 0 0 12px rgba(200, 84, 66, 0.16);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(200, 84, 66, 0.28), 0 0 24px rgba(200, 84, 66, 0.34);
  }
}

.text-styling-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.text-styling-grid > div {
  position: relative;
}

.text-path-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.text-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.text-entry-header label {
  font-size: 14px;
  font-weight: 600;
}

.text-entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-entry-actions {
  margin-left: auto;
}

.text-character-count {
  font-size: 12px;
  color: var(--text-dim);
}

.icon-action-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-control);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
}

.icon-action-button:hover {
  background: var(--bg-control-hover);
}

.text-repeat-toggle {
  margin: 0;
}

.text-size-inline {
  margin: 0;
}

.text-preview-card {
  margin-top: -2px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.text-preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.text-preview-header span:first-child {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.text-preview-copy {
  font-size: 11px;
  color: var(--text-dim);
}

.text-preview-canvas {
  width: 100%;
  height: 120px;
  display: block;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.text-core-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.text-style-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.text-style-heading {
  margin: 0 0 4px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.text-styling-grid-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.text-styling-grid-three label {
  font-size: 12px;
  display: block;
  margin-bottom: 3px;
}

.color-preview-small {
  width: 30px;
  height: 30px;
  border: 2px solid white;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.shared-text-color-picker {
  margin-bottom: 12px;
}

.shared-text-color-picker.hidden {
  display: none;
}

.shared-text-color-label {
  font-size: 12px;
    color: var(--text-muted);
  margin-bottom: 6px;
}

#sharedTextColorPicker {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  border: 2px solid var(--border-strong) !important;
  border-radius: 6px !important;
}

/* Hide cursor dots for all color pickers */
#sharedTextColorCursor,
#colorPickerCursor {
  display: none !important;
}

/* Responsive positioning for small screens */
@media screen and (max-width: 768px) {
  .shared-text-color-picker {
    margin-bottom: 10px;
  }
}

/* Mobile Media Queries */
@media screen and (max-width: 1024px) {
  .image-blur-control {
    display: none;
  }

  .sidebar-menu {
    position: fixed;
    top: var(--top-nav-visual-offset);
    left: 0;
    right: 0;
    width: 100%;
    height: var(--top-nav-height);
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 15px;
    border-right: none;
    border-bottom: 2px solid #333;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .sidebar-menu::-webkit-scrollbar {
    display: none;
  }

  .menu-icon {
    width: 48px;
    height: 44px;
    padding: 8px;
    margin-bottom: 0;
    flex-shrink: 0;
    border-radius: 6px;
  }

  .sliding-panel {
    top: calc(var(--top-nav-height) + var(--top-nav-visual-offset));
    bottom: calc(var(--bottom-menu-height) + var(--bottom-menu-safe-inset) + var(--bottom-menu-visual-offset));
    left: 0;
    right: 0;
    width: auto;
    height: auto;
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    border: none;
    border-radius: 0;
    z-index: 401;
    padding: 18px 18px 80px 18px;
    background: rgba(37, 41, 47, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .sliding-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .panel-modal-backdrop {
    position: fixed;
    inset: calc(72px + var(--top-nav-visual-offset)) 0 calc(60px + var(--bottom-menu-visual-offset)) 0;
    background: rgba(9, 10, 12, 0.3);
    z-index: 400;
  }

  .panel-modal-backdrop.open {
    display: block;
  }

  .canvas-container {
    margin-left: 0;
    margin-top: calc(72px + var(--top-nav-visual-offset));
    margin-bottom: calc(60px + var(--bottom-menu-visual-offset));
  }

  .bottom-menu {
    left: 0;
    height: 60px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 15px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }

  .bottom-menu::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .bottom-menu-button {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 80px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .bottom-menu-button span {
    display: none;
  }

  .bottom-menu-button {
    min-width: 48px;
    width: 48px !important;
    max-width: 48px;
    padding: 8px;
    justify-content: center;
    gap: 0;
  }

  #bottomPlayStopBtn,
  #bottomRecordStopBtn {
    width: 48px !important;
    max-width: 48px;
    min-width: 48px;
  }

  .bottom-menu-logo {
    height: 40px;
    margin-left: 2px;
  }

  .bottom-menu-logo-image {
    height: 50px;
    max-width: 92px;
  }

  .recording-status {
    flex-shrink: 0;
    min-width: auto;
    display: none;
  }

  .recording-status.active {
    display: flex;
    min-width: 100px;
  }
  .section {
    margin-bottom: 20px;
    padding: 12px;
  }

  .color-picker {
    width: 100%;
    height: 120px;
  }

  .effects-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .effect-btn {
    min-height: 58px;
    padding: 8px 4px;
    font-size: 10px;
  }
}

@media screen and (max-width: 768px) {
  .text-path-layout {
    gap: 8px;
  }

  .text-preview-card {
    margin-top: -4px;
    padding: 10px;
  }

  .text-preview-canvas {
    height: 108px;
  }

  .icon-action-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  input[type="range"] {
    height: 36px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
  }

  input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background: var(--bg-control-hover);
    border-radius: 999px;
  }

  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -8px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }

  input[type="range"]::-moz-range-track {
    height: 8px;
    background: var(--bg-control-hover);
    border-radius: 999px;
  }

  input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }

  .section h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .slider-container label {
    font-size: 12px;
  }

  .color-picker {
    height: 100px;
  }


  .text-styling-grid {
    grid-template-columns: 1fr;
  }

  .text-styling-grid-three {
    grid-template-columns: 52px 52px 52px;
    justify-content: start;
    align-items: start;
    gap: 6px;
  }

  #textInput {
    min-height: 100px !important;
    height: 100px !important;
    font-size: 16px !important;
  }

  textarea,
  input[type="text"],
  select {
    font-size: 16px;
  }
}

@media screen and (max-width: 480px) {
  .text-entry-header {
    align-items: center;
  }

  .text-entry-meta {
    gap: 6px;
  }

  .text-character-count {
    font-size: 11px;
  }

  .text-preview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  body {
    font-size: 14px;
  }

  .section {
    margin-bottom: 15px;
    padding: 10px;
  }

  .section h3 {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .slider-container {
    margin: 8px 0;
  }

  .color-picker {
    height: 80px;
  }

  .color-preview {
    width: 30px;
    height: 30px;
  }

  .effects-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .effect-btn {
    min-height: 52px;
    padding: 6px 3px;
    font-size: 9px;
  }

  .export-modal-card {
    width: calc(100vw - 24px);
    padding: 20px;
  }

  .export-modal-title {
    font-size: 20px;
  }

  .play-controls {
    flex-direction: column;
    gap: 6px;
  }

  button {
    padding: 8px;
    font-size: 12px;
  }

  #textInput {
    min-height: 100px !important;
    height: 100px !important;
    font-size: 16px !important;
  }

  textarea,
  input[type="text"],
  select {
    font-size: 16px;
  }
}
