[data-theme="m3e"] {
  /* M3 Baseline Dark Theme Palette Tokens */
  --md-sys-color-background: #121212;
  --md-sys-color-on-background: #E6E1E5;
  --md-sys-color-surface: #1C1B1F;
  --md-sys-color-surface-container: #2B2930;
  --md-sys-color-primary: #D0BCFF;
  --md-sys-color-on-primary: #381E72;
  --md-sys-color-outline: #938F99;

  /* Expressive Corner Radii */
  --md-shape-corner-large: 20px;
  --md-shape-corner-extra-large: 32px;
  --md-shape-corner-xxl: 48px;
  --md-shape-corner-full: 9999px;

  /* Expressive Motion Curves (Spring Simulation Physics) */
  --md-motion-easing-expressive: cubic-bezier(0.34, 1.56, 0.64, 1);
  --md-motion-duration-short: 200ms;
  --md-motion-duration-medium: 400ms;

  /* Official M3 Font Tokens */
  --md-font-family: 'Roboto Flex', sans-serif;
  --md-font-display-weight: 850;
  --md-font-body-weight: 400;

  /* Map to Petals theme variables */
  --bg:        #121212;
  --bg-2:      #1C1B1F;
  --bg-3:      #2B2930;

  --border:       rgba(147, 143, 153, 0.25);
  --border-hover: rgba(147, 143, 153, 0.50);

  --mint:         #D0BCFF;
  --mint-dim:     rgba(208, 188, 255, 0.6);
  --mint-glow:    rgba(208, 188, 255, 0.08);

  --accent:       #D0BCFF;
  --accent-glow:  rgba(208, 188, 255, 0.14);

  --text:         #E6E1E5;
  --text-dim:     #938F99;
  --text-bright:  #FFFFFF;

  --font-sans: 'Roboto Flex', sans-serif;
  --font-mono: 'Roboto Flex', sans-serif;
}
/* Expressive motion on interactive elements */
[data-theme="m3e"] .glance,
[data-theme="m3e"] .glance:hover {
  transition: border-color var(--md-motion-duration-short) ease,
              transform var(--md-motion-duration-short) var(--md-motion-easing-expressive);
}

[data-theme="m3e"] .glance:hover {
  transform: translateY(-2px) scale(1.01);
}

[data-theme="m3e"] #glance-form:focus-within {
  border-radius: var(--md-shape-corner-extra-large);
}

[data-theme="m3e"] #auth-box {
  border-radius: var(--md-shape-corner-extra-large);
}

[data-theme="m3e"] #login-btn,
[data-theme="m3e"] #submit-button,
[data-theme="m3e"] .save-btn {
  border-radius: var(--md-shape-corner-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform var(--md-motion-duration-short) var(--md-motion-easing-expressive),
              box-shadow var(--md-motion-duration-short) ease,
              background var(--md-motion-duration-short) ease;
}

[data-theme="m3e"] #login-btn:hover,
[data-theme="m3e"] #submit-button:hover {
  background: #E8DEF8;
  color: #1C1B1F;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px) scale(1.02);
}

[data-theme="m3e"] .save-btn:hover:not(:disabled) {
  background: #E8DEF8;
  color: #1C1B1F;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px) scale(1.02);
}

[data-theme="m3e"] .upload-bar {
  box-shadow: 0 0 8px rgba(208, 188, 255, 0.35);
}

[data-theme="m3e"] .settings-section,
[data-theme="m3e"] .profile-header {
  border-radius: var(--md-shape-corner-large);
}

[data-theme="m3e"] .site-title {
  font-weight: var(--md-font-display-weight);
  font-family: var(--md-font-family);
}

[data-theme="m3e"] .auth-logo {
  font-weight: var(--md-font-display-weight);
  font-size: var(--md-font-display-size, 2.5rem);
  font-family: var(--md-font-family);
}

[data-theme="m3e"] .glance {
  border-radius: var(--md-shape-corner-large);
}

[data-theme="m3e"] .dm-layout {
  border-radius: var(--md-shape-corner-extra-large);
}

[data-theme="m3e"] .dm-send-btn {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="m3e"] .dm-send-btn:hover:not(:disabled) {
  background: #E8DEF8;
  color: #1C1B1F;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

[data-theme="m3e"] .dl-card {
  border-radius: var(--md-shape-corner-large);
}

[data-theme="m3e"] .toast {
  border-radius: var(--md-shape-corner-full);
}

[data-theme="m3e"] .ext-link-modal {
  border-radius: var(--md-shape-corner-extra-large);
}

[data-theme="m3e"] .md-font-display {
  font-family: var(--md-font-family);
  font-weight: var(--md-font-display-weight);
}
